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

roslaunch use arg to launch

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

shawnysh gravatar image

I'd like to roslaunch 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="" 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

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

The 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



Thanks for your help! It really helps!

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

Question Tools

1 follower


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

Seen: 916 times

Last updated: Jan 12 '17