Ask Your Question

How to start ROS2 node automatically after starting the system?

asked 2019-09-26 00:16:21 -0500

D0l0RES gravatar image

How to make autostart of nodes in ROS2 at system startup? I tried through rc.local and nothing good came of it.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-10-02 03:00:50 -0500

Dmitriy gravatar image

updated 2019-10-02 03:12:17 -0500

We use systemd service with properly defined environment variables, works fine. Example:

Description="Project daemon"


ExecStart=/opt/ros/dashing/bin/ros2 launch --debug project_bringup

edit flag offensive delete link more

answered 2019-09-26 03:07:50 -0500

aPonza gravatar image

updated 2019-09-26 03:15:14 -0500

Not really a ROS-related question, but you likely want to look into cron (assuming *nix since you speak of rc.local) with @reboot, for example as seen in this article.

There are plenty of questions about the details of what else you need to do though: try googling "ros node at startup" and see what's applicable to ROS2 as well.

EDIT: best answer for ROS1 even though I couldn't find a ROS2 equivalent of the robot_upstart package.

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



Asked: 2019-09-26 00:16:21 -0500

Seen: 790 times

Last updated: Oct 02 '19