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
1

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

Thanks for your help! It really helps!

shawnysh gravatar imageshawnysh ( 2017-01-14 07:48:04 -0500 )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: 2017-01-12 05:37:34 -0500

Seen: 410 times

Last updated: Jan 12 '17