Ask Your Question
0

Use roslaunch to run turtlesim automatically

asked 2018-03-22 20:56:07 -0600

mmcoose gravatar image

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.

edit retag flag offensive close merge delete

Comments

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.

mgruhler gravatar imagemgruhler ( 2018-03-23 01:46:00 -0600 )edit

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.

mmcoose gravatar imagemmcoose ( 2018-03-24 08:20:13 -0600 )edit

Yes, this would still require you to write your own launchfile.

mgruhler gravatar imagemgruhler ( 2018-03-26 01:06:01 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-03-23 15:27:12 -0600

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

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.

edit flag offensive delete link more

Comments

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

mmcoose gravatar imagemmcoose ( 2018-03-24 08:15:22 -0600 )edit

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.

mmcoose gravatar imagemmcoose ( 2018-03-24 08:16:55 -0600 )edit

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.

Rodolfo8 gravatar imageRodolfo8 ( 2018-03-24 10:02:51 -0600 )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: 2018-03-22 20:56:07 -0600

Seen: 332 times

Last updated: Mar 23 '18