Ask Your Question
0

Systemd+roslaunch fails with Turtlebot

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

chris93 gravatar image

Hi,

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/startup.sh (code=exited, status=1/FAILURE)

Any suggestions on why my system crashes?
Cheers

edit retag flag offensive close merge delete

Comments

1

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/env.sh roslaunch turtlebot2i_bringup turtlebot2i_basic.launch

rreignier gravatar imagerreignier ( 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 imagechris93 ( 2019-10-10 01:45:04 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

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!

Cheers

edit flag offensive delete link more

Comments

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

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

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

Stats

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

Seen: 14 times

Last updated: Oct 10