From 93324597fdd4d087a4e3f897d413647a7c7ea8d2 Mon Sep 17 00:00:00 2001 From: Shingo Kitagawa Date: Tue, 4 Oct 2022 00:29:21 +0900 Subject: [PATCH] [jsk_fetch_startup] add config/config.bash and use it in robot.conf and install_supervisor.sh --- jsk_fetch_robot/jsk_fetch_startup/config/config.bash | 7 +++++++ .../jsk_fetch_startup/config/install_supervisor.sh | 5 +++++ .../jsk_fetch_startup/supervisor_scripts/robot.conf | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 jsk_fetch_robot/jsk_fetch_startup/config/config.bash diff --git a/jsk_fetch_robot/jsk_fetch_startup/config/config.bash b/jsk_fetch_robot/jsk_fetch_startup/config/config.bash new file mode 100644 index 0000000000..ea364d3b12 --- /dev/null +++ b/jsk_fetch_robot/jsk_fetch_startup/config/config.bash @@ -0,0 +1,7 @@ +# This file is bash configuration for robot.conf +# This file must be at /var/lib/robot/config.bash + +export RS_SERIAL_NO_T265="" +export RS_SERIAL_NO_D435_FRONTRIGHT="" +export RS_SERIAL_NO_D435_FRONTLEFT="" +export RS_SERIAL_NO_L515_HEAD="" diff --git a/jsk_fetch_robot/jsk_fetch_startup/config/install_supervisor.sh b/jsk_fetch_robot/jsk_fetch_startup/config/install_supervisor.sh index 9f77c428b9..d07fbfb529 100755 --- a/jsk_fetch_robot/jsk_fetch_startup/config/install_supervisor.sh +++ b/jsk_fetch_robot/jsk_fetch_startup/config/install_supervisor.sh @@ -15,4 +15,9 @@ for file in $(ls ./*.conf); do echo "copied $file to /etc/supervisor/conf.d" done +# copy config.bash to /var/lib/robo if not exists +if [ ! -e /var/lib/robot/config.bash ]; then + sudo cp $jsk_fetch_startup/config/config.bash /var/lib/robot/config.bash +fi + set +x diff --git a/jsk_fetch_robot/jsk_fetch_startup/supervisor_scripts/robot.conf b/jsk_fetch_robot/jsk_fetch_startup/supervisor_scripts/robot.conf index d265c59b0d..0862a3af71 100644 --- a/jsk_fetch_robot/jsk_fetch_startup/supervisor_scripts/robot.conf +++ b/jsk_fetch_robot/jsk_fetch_startup/supervisor_scripts/robot.conf @@ -1,5 +1,5 @@ [program:robot] -command=/bin/bash -c ". /opt/ros/roscore_poststart.bash && . /home/fetch/ros/melodic/devel/setup.bash && rosrun jsk_fetch_startup link_calibration_files.bash && roslaunch jsk_fetch_startup fetch.launch launch_teleop:=false --wait --screen" +command=/bin/bash -c ". /opt/ros/roscore_poststart.bash && . /home/fetch/ros/melodic/devel/setup.bash && if [ -e /var/lib/robot/config.bash ];then . /var/lib/robot/config.bash ;fi && rosrun jsk_fetch_startup link_calibration_files.bash && roslaunch jsk_fetch_startup fetch.launch launch_teleop:=false --wait --screen" stopsignal=TERM directory=/home/fetch/ros/melodic autostart=true