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

roslaunch use arg to launch serial_node.py

asked 2017-01-12 05:37:34 -0500

shawnysh gravatar image

I'd like to roslaunch serial_node.py node with launch file.

I add arg tag in launch file

<arg name="_port" default="/dev/ttyACM0" />
<arg name="_baud" default="9600/>"
<node name="serial_node" pkg="rosserial_python" type="serial_node.py" args="$(arg _port) $(arg _baud)"/>

But after I roslaunch the launch file, it fails. It seems like the two arg do not work at all

[ERROR] [WallTime: 1484219964.751265] Error opening serial: could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-01-12 08:14:02 -0500

The serial_node.py node requires private parameters not command line arguments. You need to be using <param> tags instead of the args attribute. Check out the Examples section on the rosserial_python wiki page for an example of how to do this.

edit flag offensive delete link more

Comments

1

Thanks for your help! It really helps!

shawnysh gravatar image shawnysh  ( 2017-01-14 07:48:04 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-01-12 05:37:34 -0500

Seen: 951 times

Last updated: Jan 12 '17