-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker_sim_launcher.sh
More file actions
executable file
·46 lines (38 loc) · 1.04 KB
/
docker_sim_launcher.sh
File metadata and controls
executable file
·46 lines (38 loc) · 1.04 KB
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
#!/bin/bash
set -o errexit
set -o pipefail
rebuild=false
target='robot'
while getopts :rph flag
do
case "${flag}" in
r) rebuild=true;;
p) target='podium';;
h) echo 'Run Simulator'
echo 'Default just runs'
echo '-p : podium simulator'
echo '-r : force rebuild'
exit 0;;
:) echo 'missing argument' >&2; exit 1;;
\?) echo 'invalid option' >&2; exit 1
esac
done
mkdir -p ~/flo_db
XSOCK=/tmp/.X11-unix
export XSOCK
XAUTH=/tmp/.docker.xauth
export XAUTH
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
ROS_USER=$(id -u "$USER"):$(id -g "$USER")
export ROS_USER
R_GID=$(id -g "$USER")
R_UID=$(id -u "$USER")
export R_GID
export R_UID
pactlmod=$(pactl load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket)
trap 'pactl unload-module "$pactlmod"' EXIT
if [ "$rebuild" = true ] ; then
docker-compose -f "docker-compose-$target-sim.yml" build --no-cache
fi
docker-compose -f "docker-compose-$target-sim.yml" up