There are plenty of google and answers.ros hits on this but they all seem a bit complicated and also not necessarily up to the latest date. Here are some, of various vintages and from various sources. We’re trying them but nothing is “smooth”, hence this question
We are running ROS 1 Noetic on Ubuntu 20.04 on Turtlebot3s with Rasberry Pi 3+. We would like to create a ROS .launch file which is automatically run when the OS first starts up. This is not totally trivial because to ROS launch you need to have the environment set up correctly and also be the “correct” user; and there are probably other pre-requisites that I don’t even know about.
What do people think is the “best” way to do this nowadays?
In a loosely related thread last week, this comment was shared by @mgrrx to make use of launch files alongside systemd.
I can’t offer any insight on ‘best’, but leveraging the existing Linux utilities as much as possible makes sense to me.
This is a good starting point for writing your own systemd startup script → robot_systemd/roslaunch@.service at master · LucidOne/robot_systemd · GitHub
Somewhat related too, you can package your application as a snap and have it run has a daemon. In this blog series we did just that for the TurtleBot3. Upon boot the robot is ready to go (controller, sensors, tf tree, teleop, etc). Check also this short video.
If on Ubuntu, the simplest way is to manually create a startup application. Click on the icon “Startup Application” on the activities, then “Add”. Then customize the name and fill the command field with:
terminator -e "bash -i -c 'sleep 3 && ros2 launch myrobot_bringup myrobot_bringup.launch'"
if ROS1 i guess it will be more something like :
terminator -e "bash -i -c 'sleep 3 && roslaunch myrobot_bringup myrobot_bringup.launch'"
This assumes you have terminator installed, you can adapt to whatever terminal emulator you prefer using (the flags could then be different). I use sleep 3 to wait 3 seconds after startup before launching ros (I have few things that take a bit of time starting).
And course the creation of the startup application can be automated in a script.
Wow, totally over my head though. I think I need a far longer beard to be able to go that deep! Interesting though
Wow, that really works? In headless mode, or does it require a GUI running?
Awesome presentation. Many practical ideas.
Never tried headless but I don’t see why it wouldn’t work
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.