-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_aliases
executable file
·140 lines (118 loc) · 3.74 KB
/
.bash_aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#! /usr/bin/env bash
build (){
if catkin build "$@"
then
echo 🍻
else
echo 💔
fi
}
build_only(){
build "$@" --no-deps
}
copy_to_drone(){
scp "$1" root@"$(scout-find-drone)":"$2"
}
cleanup() {
echo "Killing roscore"
kill "$ROSCORE_PID"
kill "$PCL_ROS_PID"
}
cloud_rviz(){
if [ ! -f "$1" ]; then
echo "Input file does not exist: $1"
return 1
fi
if ! pgrep -x "rosmaster" > /dev/null; then
echo "Starting roscore"
roscore &
ROSCORE_PID=$!
# Set trap to call cleanup function on script exit
trap cleanup EXIT
fi
rosrun pcl_ros pcd_to_pointcloud "$1" 1.0 _latch:=true _frame_id:=map &
PCL_ROS_PID=$!
rviz -d ~/workspace/rviz_configs/pcd_viewer.rviz
}
metrical() {
docker run --rm --init --user="$(id -u):$(id -g)" \
--volume="/home/ola/bags/internal/calibration":"/datasets" \
--workdir="/datasets" \
--add-host=host.docker.internal:host-gateway \
--volume=/home/ola/.config/tangram-vision/config.toml:/.config/tangram-vision/config.toml:ro \
tangramvision/cli:dev-latest \
"$@";
}
gocker() {
tmp_docker=$(sudo find /tmp -type d -name '.docker*')
docker run --rm -it --name gui-docker --network host --gpus all \
--privileged -e SSH_AUTH_SOCK -v /run/user/1000/keyring/ssh:/run/user/1000/keyring/ssh \
-e DISPLAY -e TERM -e QT_X11_NO_MITSHM=1 -e XAUTHORITY="$tmp_docker" \
-v "$tmp_docker":"$tmp_docker" -v /tmp/.X11-unix:/tmp/.X11-unix \
-v /etc/localtime:/etc/localtime:ro \
"$@"
}
ola-qgc() {
docker run -it --privileged --gpus=all --runtime=nvidia --network host \
--volume /home/ola/workspace/:/home/ola/workspace \
qgc-launch \
/home/ola/workspace/qgroundcontrol/build/staging/CustomQGroundControl
}
ola-qgc-build-appimage() {
docker run --rm --device /dev/fuse --privileged \
-v "$HOME"/workspace/qgroundcontrol:/project/source \
-v "$HOME"/workspace/qgroundcontrol/build:/project/build \
qgc-build-appimage:latest
}
ola-qgc-build-apk() {
docker run --rm --device /dev/fuse --privileged \
-v "$HOME"/workspace/qgroundcontrol:/project/source \
-v "$HOME"/workspace/qgroundcontrol/android_build:/project/android_build \
qgc-build-apk
}
function ola-set-ws {
local new_ws=$1
if [[ -z "$new_ws" ]]; then
echo "Please provide a workspace name."
return 1
fi
local file="$HOME/.scout-zshrc"
local new_line="source $HOME/workspace/catkin/$new_ws/devel/setup.zsh"
# Ensure the target file exists
if [[ ! -f "$file" ]]; then
echo "The file $file does not exist."
return 1
fi
# Change the workspace source line
sed -i "s|source $HOME/workspace/catkin/.*|${new_line}|" "$file"
echo "Workspace set to '$new_ws'."
}
#drone
alias scpd='copy_to_drone'
# source
alias s='source $HOME/.bashrc'
alias z='source $HOME/.zshrc'
# ros
alias cb='build'
alias cbn='build_only'
alias ros="roscd && cd ../src"
alias cross='cd $HOME/workspace/catkin/cross && source scout-source-crosscompile -s ~/workspace/sdks/cpr-gtsam'
# git
alias rb="git rebase -i origin/master"
alias gca="git add . && git commit --amend --no-edit"
# dev
alias todo='micro $HOME/workspace/todo.txt'
alias dbash="docker exec -it scout-dev-noetic bash"
alias dzsh="docker exec -it scout-dev-noetic zsh"
alias u='$HOME/workspace/unreal_linux_build/ScoutAirSim.sh'
alias unreal="/home/ola/workspace/UnrealEngine/Engine/Binaries/Linux/UE4Editor"
alias work="cd ~/workspace"
alias sim="roslaunch scout_simulation full.launch"
alias simu="roslaunch scout_simulation full.launch simulator:=airsim"
alias t="trash-put"
alias c="clear"
alias ola-plotjuggler="(source /home/ola/Code/plotjuggler_ws/devel/setup.zsh && roslaunch plotjuggler_ros plotjuggler.launch)"
alias cloud_viz='cloud_rviz'
scout-clone() {
git clone [email protected]:scoutdi/"$@".git
}