0
$\begingroup$

Rosanswers logo

Does anyone have a .launch file for launching turtlesim automatically on a Raspberry Pi? My team is prgramming a robot run on a raspberry pi with ROS. There is a control computer that we connect wirelessly to the raspberry pi. The master and slave are configured properly, but ROScore, turtlesim and other desired ROS nodes need to be launched upon booting up the Raspberry Pi so that we can untether the robot from the monitor. Please help and give an example of a launch file where we can easily edit for turlesim and other nodes if possible. We are beginners in using ROS for robotic applications.


Originally posted by mmcoose on ROS Answers with karma: 1 on 2018-03-22

Post score: 0


Original comments

Comment by mgruhler on 2018-03-23:
Is you question about how to best automatically start ROS nodes? Then robot_upstart would be something for you. This installs launch files as upstart scripts. If your question is more about the turtlesim launch files, please provide some more Details.

Comment by mmcoose on 2018-03-24:
Hi Mig,

We want to run roscore, turtlesim_node and a command for executing arduino code upon booting our rpi. If I use robot_upstart and download the github files, do I still need to write my own launch file? I do not understand the syntax for setting that up.

Comment by mgruhler on 2018-03-26:
Yes, this would still require you to write your own launchfile.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

https://help.ubuntu.com/community/CronHowto

See the part about @reboot

You may start a shell script that starts the launch file; I know that works well. Here's a sample:

#!/bin/bash
source ~/.bashrc
source catkin_ws/devel/setup.bash
roslaunch jet_bringup jet_real.launch
exit

Just remember to make your shell script text file executable with the chmod 755 command.


Originally posted by Rodolfo8 with karma: 299 on 2018-03-23

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by mmcoose on 2018-03-24:
Hi Rodolfo,

If I use the Cron option. Where do I place the @reboot line of code? Does it belong in the .bashrc? Our goal is to have these 3 nodes running automatically in the background:

  1. roscore
  2. turtlesim turtlesim_node
  3. a line of code that activates our motors, sensor and servomotor

Comment by mmcoose on 2018-03-24:
The 3rd line is related to code written for the Arduino board.

If we use the launch file option, do we need to write a "jet_real.launch" file first? This is the part I do not understand, but I think it is actually what we need.

Comment by Rodolfo8 on 2018-03-24:
Please read the Cron document. This is a scheduled job, very easy to set up. It will run at reboot only.

The launch file should be your own launch file that you want to start at boot. I put the "source" line in there because it didn't work right without it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.