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

How to create a ros launch file for arduino node?

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

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

Comments

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 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
3

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

Farid gravatar image

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

$ rosrun rosserial_python serial_node.py _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:

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

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

Comments

1

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 -0600 )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 -0600 )edit

Question Tools

4 followers

Stats

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

Seen: 4,299 times

Last updated: Jun 28 '18