Skip to content

Instantly share code, notes, and snippets.

@annesteenbeek
Created February 13, 2017 15:19
Show Gist options
  • Save annesteenbeek/f4d939e897010b30b673d4f105c69618 to your computer and use it in GitHub Desktop.
Save annesteenbeek/f4d939e897010b30b673d4f105c69618 to your computer and use it in GitHub Desktop.
A simple function for init.d to have a roslaunch run at startup at tty8 and tty9
start_ros () {
source /opt/ros/setup.sh
roscore <>/dev/tty8 2>/dev/tty8 & disown
until rostopic list ; do sleep 1; done
roslaunch YOUR_PACKAGE YOUR_LAUNCH_FILE.launch <> /dev/tty9 2>/dev/tty9 & disown
}
stop_ros () {
source /opt/ros/setup.sh
#killall nodes
for i in $( rosnode list ); do
rosnode kill $i;
done
#stop roscore
killall roscore
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment