Cannot retrieve existing param
Hi, It seems I cannot retrieve an existing parameter using roscpp, neither using the node handle nor ros::param. What I want to do is access parameters of a different node. For example, let's consider a node A which wants to read the parameter of a node B, let's say move_base.
So in node A I want to read the parameter /move_base/local_costmap/height, for example. If I use
rosparam get /move_base/local_costmap/height
I get the value just fine. If I use in node A's code either
ros::NodeHandle n;
std::string param("/move_base/local_costmap/height"), param_value;
n.getParam(param,param_value);
or
std::string param("/move_base/local_costmap/height"), param_value;
ros::param::get(param,param_value);
I do not get the parameter. On the other hand both
ros::param::has(param);
and
nh.hasParam(param);
return 1. I know that this is not the preferred way of accessing other nodes' parameters. But I need it for documentation in a fixed setup. The limitations, .e.g, having to know a node's absolute path, are, in this case, acceptable. Can someone point me in the correct direction how to retrieve the param values or point out other ways how to retrieve parameter values for multiple nodes from one location using roscpp? I'd prefer not to use rosparam as it complicates things.
Thanks for you help.