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

launchfile's <args> problem

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

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

__name:=my_node
__log:=xxxxx.log

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

edit retag flag offensive close merge delete

Comments

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 -0500 )edit

Thank you.

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

1 Answer

Sort by ยป oldest newest most voted
1

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

gvdhoorn gravatar image

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

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

Comments

Thanks a lot for your response.

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

Question Tools

Stats

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

Seen: 197 times

Last updated: Oct 01 '18