Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsk_fetch_startup] fix escape evaluation in install_upstart.sh #1204

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions jsk_fetch_robot/jsk_fetch_startup/config/install_upstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ jsk_fetch_startup=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`"/.. > /dev/null &&
IFS=':' read -r -a prefix_paths <<< "$CMAKE_PREFIX_PATH"
current_prefix_path="${prefix_paths[0]}"

sudo bash -c "cat <<EOF > /etc/init/jsk-fetch-startup.conf
description \"spawn jsk bringup nodes for fetch\"
# jsk-fetch-startup
sudo bash -c "echo \"description \\\"spawn jsk bringup nodes for fetch\\\"
# use default log dir: yamaguchi & s-kitagawa (2019/04/18)
# env ROS_LOG_DIR=/var/log/ros

Expand All @@ -16,23 +16,21 @@ stop on roscore_is_down
respawn

# add ROSCONSOLE_FORMAT: s-kitagawa (2019/10/03)
env AUDIO_DEVICE=alsa_output.usb-1130_USB_AUDIO-00-AUDIO.analog-stereo
env ROSCONSOLE_FORMAT='[${severity}] [${time}] [${node}:${logger}]: ${message}'
env AUDIO_DEVICE=\\\"alsa_output.usb-1130_USB_AUDIO-00-AUDIO.analog-stereo\\\"
env ROSCONSOLE_FORMAT=\\\"[\\\${severity}] [\\\${time}] [\\\${node}:\\\${logger}]: \\\${message}\\\"

# enable usb speaker if available
pre-start script
# launch by fetch user: yamaguchi & s-kitagawa (2019/04/18)
# exec su ros -c 'pactl set-default-sink $AUDIO_DEVICE || true'
exec su fetch -c 'pactl set-default-sink $AUDIO_DEVICE || true'
# exec su ros -c \\\"pactl set-default-sink \\\$AUDIO_DEVICE || true\\\"
exec su fetch -c \\\"pactl set-default-sink \\\$AUDIO_DEVICE || true\\\"
end script

script
# launch by fetch user: yamaguchi & s-kitagawa (2019/04/18)
# exec su ros -c \". ${current_prefix_path}/setup.bash && roslaunch ${jsk_fetch_startup}/launch/fetch_bringup.launch boot_sound:=true\"
exec su fetch -c \". ${current_prefix_path}/setup.bash && roslaunch ${jsk_fetch_startup}/launch/fetch_bringup.launch boot_sound:=true\"
end script

EOF"
# exec su ros -c \\\". ${current_prefix_path}/setup.bash && roslaunch ${jsk_fetch_startup}/launch/fetch_bringup.launch boot_sound:=true\\\"
exec su fetch -c \\\". ${current_prefix_path}/setup.bash && roslaunch ${jsk_fetch_startup}/launch/fetch_bringup.launch boot_sound:=true\\\"
end script\" > /etc/init/jsk-fetch-startup.conf"
echo "== cat /etc/init/jsk-fetch-startup.conf =="
cat /etc/init/jsk-fetch-startup.conf
echo "== usage: sudo service jsk-fetch-startup restart =="