-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·30 lines (27 loc) · 926 Bytes
/
run.sh
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
#!/usr/bin/env bash
source /opt/ros/${ROS_DISTRO}/setup.bash
# execute .bashrc if it has "source */setup.bash"
if [ ! -z "`cat ${HOME}/.bashrc | grep "^source .*setup\.bash *$"`" ]; then source ${HOME}/.bashrc; fi
usb_arg=`python3 ./util/generate_usb_arg.py`
if [ "$DISPLAY" == "localhost:10.0" ]; then
sudo docker run -it --rm \
--net=host \
--env="DISPLAY" \
--volume="${HOME}/.Xauthority:/root/.Xauthority:rw" \
-w="/home/leus" \
--net="host" \
--env ROS_MASTER_URI="${ROS_MASTER_URI}" \
${usb_arg} \
future731/ball_orbit_estimator "$@"
else
xhost +local:
sudo docker run -it --rm \
--net=host \
--env="DISPLAY" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
-w="/home/leus" \
--net="host" \
--env ROS_MASTER_URI="${ROS_MASTER_URI}" \
${usb_arg} \
future731/ball_orbit_estimator "$@"
fi