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

Passing USB Port argument to included launch file

asked 2021-07-04 04:08:39 -0500

masterkey gravatar image

updated 2022-04-30 13:20:35 -0500

lucasw gravatar image

Hi Folks,

I have 2 launch files that i will start with executing one launch file.

In the one launch file i integrated the launch-files with <include> :

<?xml version="1.0"?>

<launch>

<include file="$(find curio_base)/launch/arduino_controller.launch port:=/dev/ttyUSB0" >
</include>

<include file="$(find curio_base)/launch/base_controller.launch" >
</include>

</launch>

I get the error:

RLException: while processing /home/masterkey/curio_ws/src/curio/curio_base/launch/arduino_controller.launch 
port:=/dev/ttyUSB0:
Invalid roslaunch XML syntax: [Errno 2] No such file or directory: 
u'/home/masterkey/curio_ws/src/curio/curio_base/launch/arduino_controller.launch port:=/dev/ttyUSB0'
The traceback for the exception was written to the log file

If I enter in the termianl:

roslaunch curio_base arduino_controller.launch port:=/dev/ttyUSB0

it works.

How do I specify the port:=/dev/ttyUSB0 expression correctly in the launch file?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-07-04 05:51:09 -0500

gvdhoorn gravatar image

It looks like you're trying to pass an argument to an included .launch file.

You don't do that by including the argument in the file attribute of the include element, but by adding an arg child element to the include:

<include file="$(find curio_base)/launch/arduino_controller.launch">
  <arg name="port" value="/dev/ttyUSB0" />
</include>

Refer to wiki/roslaunch/XML/arg.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-07-04 04:08:39 -0500

Seen: 301 times

Last updated: Jul 04 '21