ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Try to replace
nhp.searchParam("/r_arm/position/my_param", temp);
with
nhp.getParam("/r_arm/position/my_param", temp);
searchParam()
searches the namespace tree upwards and returns the name of the first existing parameter, not its value. You still would have to call getParam()
to retrieve the value. The XmlRpc::XmlRpcValue
is implicitly casted into a string reference when passed to searchParam()
and therefore has type TypeString
afterwards.
See http://wiki.ros.org/roscpp_tutorials/Tutorials/Parameters#Searching_for_Parameters for further details.