Ask Your Question
2

unused args [...] for include of [...]

asked 2016-07-12 17:48:18 -0500

sciencectn gravatar image

I'm trying to pass an argument to a launch file, and I keep getting this error.

The main launch file has something like this:

<?xml version="1.0"?>
<launch>
    <include file="$(find p2os_urdf)/launch/upload_pioneer3at.xml">
        <arg name="foo" value="bar"/>
    </include>
 ...
</launch>

The included file looks like this:

<?xml version="1.0"?>
<launch>
    <param name="testing" value="$(arg foo)"/>
</launch>

Yet I keep getting this error:

unused args [foo] for include of [/home/sciencectn/builds/ros/src/p2os_urdf/launch/upload_pioneer3at.xml]

I assume it means the "foo" argument was never used when it clearly is. What's going on?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-07-12 19:46:35 -0500

ahendrix gravatar image

roslaunch is very strict about argument passing; you can't use an argument ($(arg foo)) without first declaring that the launch file takes an argument (<arg name="foo"/>).

in addition, passing arguments that are not expected, or failing to pass arguments that do not have a default is an error. (very similar to passing arguments when calling a function in C++ or python)

Therefore, your included launch file should be:

<?xml version="1.0"?>
<launch>
    <arg name="foo"/> <!-- declare that this launch file requires an argument -->

    <param name="testing" value="$(arg foo)"/> <!-- use the argument -->
</launch>
edit flag offensive delete link more

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: 2016-07-12 17:48:18 -0500

Seen: 4,038 times

Last updated: Jul 12 '16