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

Revision history [back]

click to hide/show revision 1
initial version

A common mistake I make is setting a param with the wrong name, e.g.

<param name="min_x" value="1.0"/>

instead of

<param name="x_min" value="1.0"/>

Most of the time, the incorrectly named param does not exist.

Thing is: by adding that param element, min_x does exist. You've just created a parameter with that name.

I would like to know if there's a way to detect non-existent params and show a warning which will very likely hint in an incorrectly named param.

That would be great, but how would roslaunch know which parameters your node(s) accept(s)? In ROS 1, there is no infrastructure for roslaunch to use. There is also no way for nodes to indicate which parameters they need/look at.

A common mistake I make is setting a param with the wrong name, e.g.

<param name="min_x" value="1.0"/>

instead of

<param name="x_min" value="1.0"/>

Most of the time, the incorrectly named param does not exist.

Thing is: by adding that param element, min_x does exist. You've just created a parameter with that name.

I would like to know if there's a way to detect non-existent params and show a warning which will very likely hint in an incorrectly named param.

That would be great, but how would roslaunch know which parameters your node(s) accept(s)? In ROS 1, there is no infrastructure for roslaunch to use. There is also no way for nodes to indicate which parameters they need/look at.


Edit: what would be good and which would also avoid many of the problems with this, is for nodes to not use any default values for parameters. Instead, they should fail immediately if they can't find a parameter.

In case you set min_x, but the node requires x_min, it prints an error and it's immediately clear you've made a mistake with the parameter name.