getParam question
I seem to be unable to gain access to params passed to node....I want to read them from a callback.
<node name="xxxx" pkg="xxxx" type="RGBD" clear_params="true" output="screen">
<remap from="/camera/rgb/image_raw" to="$(arg bag_image_topic)"/>
<remap from="/camera/depth_registered/image_raw" to="$(arg bag_depth_topic)"/>
<param name="base_frame" value="$(arg pose_base_frame)"/>
<param name="camera_frame" value="$(arg bag_camera_frame)"/>
</node>
in the code I have in my call back which is inside a c++ ros node.
std::string camera_frame = "notgiven";
std::string base_frame = "notgiven";
ros::param::get("base_frame", camera_frame);
ros::param::get("camera_frame", base_frame);
The variables are always set to "notgiven" .... How do I get access ?
ros::param::get("xxxx/base_frame", camera_frame); ros::param::get("xxxx/camera_frame", base_frame);
That would work, but it isn't all that robust. If the node name changes, the parameter names will change also and the code would have to be changed or the parameter names would have to be remapped.
Accessing as a private parameter will automatically resolve to the right node name.