Nice ready to use /etc/init.d/ros script
Just trying to make my ROS automatically run proper roslaunch command on headless system. I hope someone already made nice scriptwork?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Just trying to make my ROS automatically run proper roslaunch command on headless system. I hope someone already made nice scriptwork?
Hi,
Here is the functions we use in our init.d file to start / stop ros. It prints the output of the node in tty8 and tty9. It could be combined with screen for easier use as well.
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
}
I haven't found an example script, but there are two mailing list conversations about this problem where they talk about how to write one (what steps need to be in the script) that might be helpful for you.
http://ros-users.122217.n3.nabble.com/auto-start-ROS-launch-script-on-boot-up-td1687093.html
Asked: 2011-04-06 10:42:00 -0500
Seen: 3,396 times
Last updated: Apr 07 '11
rosluanch turtlebot_bring minimal.launch
Works with rosrun but not with roslaunch
roslaunch if/unless for non-boolean arguments
Launch files not copied into share folder by catkin_make
xacro problem: Invalid <param> tag: Cannot load command parameter [robot_description]
launching ros launch file from program