Query rosparam for public/private status
Can the rosparam command line tool tell me whether a parameter is private or public? If so, how?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Can the rosparam command line tool tell me whether a parameter is private or public? If so, how?
"Private" parameters aren't really "private." The concept of private parameters is just useful for bookkeeping. The "private" namespace of a node is just the namespace that has the same path as the node. The parameter server doesn't hide private parameters from other nodes.
You could, perhaps, infer that a parameter is private if there exists a node whose ROS graph path is a prefix of the parameter. However, this would be prone to errors. For example, the following launch file is valid:
<launch>
<node name="my_node" pkg="my_pkg" type="my_exe" />
<group ns="my_node">
<param name="my_private_param" value="foo"/>
<node name="my_inception_node" pkg="my_pkg" type="my_other_exe">
<param name="my_super_private_param" value="foo"/>
</node>
</group>
<node name="another_node" pkg="my_pkg" type="yet_another_exe"/>
</launch>
The parameter /my_node/my_private_param
is private to /my_node
, but it's public to /my_node/my_inception_node
. Even /another_node
can see that parameter by querying the fully-qualified path, i.e. /my_node/my_private_param
.
While there is no explicit hiding, I don't believe that you can say that:
parameter
/my_node/my_private_param
is private to/my_node
, but it's public to/my_node/my_inception_node
.
private parameters are private to the node by definition. The fact that my_inception_node
lives in the ..
My point is that there is such a thing as a private NodeHandle
, but no such thing as a private parameter. You can create a NodeHandle
scoped to any namespace you like. A private NodeHandle
is just a special case where you create a NodeHandle
scoped to the path of the node.
You're correct that a private NodeHandle
in my_inception_node
can't find /my_node/my_private_param
. That's what I meant when I called it "public" in that context.
Asked: 2017-08-18 19:34:14 -0500
Seen: 588 times
Last updated: Aug 18 '17
rosparam fails, rqt_reconfigure works with image_transport
Best practices for logging messages and parameters
pass ros param as argument to another param
Why can't you use floats for accessing parameters in roscpp?
Setting up Dynamic Reconfigure for several nodes?
what is equivalent python code for <arg= value=> in launch file?
Rename JOINT_NAMES in ur_driver test_move.py [closed]
rosparam ERROR: Parameter is not set
Running ROS node with a numeric parameter passed as string doesn't work.