Private Parameters in a sub namespace
Hello,
I have a ROS node that essentially does this:
ros::NodeHandle nh("~");
ros::NodeHandle node_handle(nh, "derp"),
node_handle.param<double>("rate", rate, 10.0);
Which means that the private parameter "rate" is pushed down into a namespace like so: derp/rate
I want to run aforementioned node from the command line and set this private parameter, but I do get errors. If the parameter were not in a sub namespace i could just launch the node by
rosrun mypack mynode _rate:=100
Running the node via rosrun mypack mynode derp/_rate:=100
Fails with a graph error. How can I set this private parameter via commandline?
Thanks!
Edit: running this with a launch file like so works:
<node name="mynode" pkg="mypack" type="mynode" output="screen"">
<param name="derp/rate" value="100.0" />
</node>
But I do need to set this parameter via commandline.
Just to make sure: the
_hz
suffix is only in your launch file example, not any of the command lines. Your C++ excerpt also doesn't show it. Are these the same nodes?Typo only local to this post, fixed thanks.