ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Nice ready to use /etc/init.d/ros script

asked 2011-04-06 10:42:00 -0600

Just trying to make my ROS automatically run proper roslaunch command on headless system. I hope someone already made nice scriptwork?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2011-04-07 18:55:37 -0600

Ugo gravatar image


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/

    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/

    #killall nodes
    for i in $( rosnode list ); do
    rosnode kill $i;

    #stop roscore
    killall roscore
edit flag offensive delete link more

answered 2011-04-07 12:16:16 -0600

William gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2011-04-06 10:42:00 -0600

Seen: 3,280 times

Last updated: Apr 07 '11