ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to create a ros launch file for arduino node?

asked 2017-01-21 23:57:06 -0500

shashikg gravatar image

Hey I wanted to open up the arduino node by using the ros launch file is there is any way to do that??

edit retag flag offensive close merge delete


What package are you using to talk to the Arduino? Both rosserial and ros_arduino_bridge are appropriate choices. You'll start nodes in those packages. Those nodes will open up the communication channel to the Arduino sketch.

Mark Rose gravatar image Mark Rose  ( 2017-01-25 13:50:28 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-06-28 02:07:21 -0500

Farid gravatar image

First you could try with a simple command line and make sure everything works:

$ rosrun rosserial_python _baud:=57600 _port:=/dev/ttyACM0

Then you make a catkin package in your catkin workspace, add a folder with a name launch in your package.

Inside your launch folder, your launch file run_arduino.launch should be created (right click -> new document -> empty document)

Here's the corresponding launch file:

    <node name="serial_node"        pkg="rosserial_python"      type="">
    <param name="port"              type="string"               value="/dev/ttyACM0"/>
    <param name="baud"              type="int"                  value="57600"/>

After creating a launch file, what you simply do is going to your package directory, where you have you launch file and use the following command to start the arduino node:

$ roslaunch /your_catkinpackage/launchFolder/run_arduino.launch
edit flag offensive delete link more



Is there a way to upload code to the Arduino using a .launch file, in addition to forwarding serial data from Arduino to roscore using serial_node?

Void gravatar image Void  ( 2019-01-01 18:10:06 -0500 )edit

Can you tell how to specify the tcp port number in a launch file?

Saums gravatar image Saums  ( 2019-08-08 15:57:09 -0500 )edit

Question Tools



Asked: 2017-01-21 23:57:06 -0500

Seen: 4,102 times

Last updated: Jun 28 '18