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

launchfile's <args> problem

asked 2018-10-01 05:02:52 -0600

Epsilon_cm gravatar image

When I write a launch file,I try to run a node with command line arguments. Just like:

<node pkg="my_pkg" type="my_type" name="my_node" output="screen" args="--my_arg my_num">

But when i check the argv parameters,i found there're more than three, the additional two is


What's wrong with it? Is there any solution to skip the aditional two comand line?

edit retag flag offensive close merge delete


In a nut shell nothing is wrong with it. ROS uses command line arguments to pass standard parameters to the node. The args property in the launch file just adds extra arguments onto these. Can you simply ignore them when processing arguments in your node?

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2018-10-01 06:51:14 -0600 )edit

Thank you.

Epsilon_cm gravatar image Epsilon_cm  ( 2018-10-01 08:03:01 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-10-01 05:07:34 -0600

gvdhoorn gravatar image

updated 2018-10-01 06:05:42 -0600

I would not call this a "problem", but I can imagine you'd like to somehow deal with this.

See #q272267.

Edit: and if the program you're launching is actually a ROS node, then you can make use of the Python shown in #q272267 directly.

But know that ROS nodes typically don't take command line arguments, but use ROS parameters.

edit flag offensive delete link more


Thanks a lot for your response.

Epsilon_cm gravatar image Epsilon_cm  ( 2018-10-01 08:02:26 -0600 )edit

Question Tools


Asked: 2018-10-01 05:01:16 -0600

Seen: 184 times

Last updated: Oct 01 '18