0
$\begingroup$

Rosanswers logo

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?


Originally posted by Epsilon_cm on ROS Answers with karma: 5 on 2018-10-01

Post score: 0


Original comments

Comment by PeteBlackerThe3rd on 2018-10-01:
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?

Comment by Epsilon_cm on 2018-10-01:
Thank you.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by gvdhoorn with karma: 86574 on 2018-10-01

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Epsilon_cm on 2018-10-01:
Thanks a lot for your response.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.