ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Systemd+roslaunch fails with Turtlebot

asked 2019-10-09 01:40:22 -0500

chris93 gravatar image


I am setting up a TurtleBot2i right now. I want to launch everything regarding ROS on startup and try to realize it with systemd.
I am at the point where my .sh-script works as long it contains:

 #!/usr/bin/env bash
bash -c "source /home/turtlebot/.bashrc && source /opt/ros/kinetic/setup.bash && source /home/turtlebot/catkin_ws/devel/setup.bash && roslaunch astra_launch astra.launch"

This basically only launches the astra camera and works fine with:

 sudo systemctl start ROSdaemon.service

Whenever I replace the launchfile with the actual command for the full robot:

 roslaunch turtlebot2i_bringup turtlebot2i_basic.launch

The systemctl exits with:

 ExecStart=/home/turtlebot/ (code=exited, status=1/FAILURE)

Any suggestions on why my system crashes?

edit retag flag offensive close merge delete



You should be able to get more logs with journalctl -u ROSdaemon.service. With systemd, I usually directly use the roslaunch command in the service file with:

ExecStart=/home/turtlebot/catkin_ws/devel/ roslaunch turtlebot2i_bringup turtlebot2i_basic.launch

rreignier gravatar image rreignier  ( 2019-10-09 07:35:17 -0500 )edit

Actually journalctl showed me a great hint - I will check on that now. Thanks already!

chris93 gravatar image chris93  ( 2019-10-10 01:45:04 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-10-10 02:39:55 -0500

chris93 gravatar image

Okay so here was the problem:

The launchfile of the turtlebot2i uses the keyword "env" as well as "optenv", which work fine when the environment is set to the correct values. Unfortunately that is not the case, when starting with systemd, some of the values have not been set and some with a different value. This leads to a wrong path for the urdf, which is non-existing and therefore leads to a failing launch. On top the replacement of the shell script with the line rreignier suggested works fine and is much prettier!


edit flag offensive delete link more


Unfortunately I cannot accept my own answer yet, because I have not enough points.

chris93 gravatar image chris93  ( 2019-10-10 02:41:04 -0500 )edit

Question Tools

1 follower


Asked: 2019-10-09 01:40:22 -0500

Seen: 236 times

Last updated: Oct 10 '19