roscpp parameters with roslaunch remapping
How can I access roscpp parameters if the node name has been remapped with roslaunch?
launch file,
<node pkg="my_package" type="my_package_node" name="remapped_name" ns="my_namespace">
<param name="camera_index" value="$(arg camera_index)" />
</node>
in cpp file,
ros::init(argc, argv, "node_default_name");
ros::NodeHandle n;
ros::param::get("node_default_name/camera_index", camera_index); // Fails
ros::param::get("remapped_name/camera_index", camera_index); // Works
n.getParam("node_default_name/camera_index", camera_index); // Fails
n.getParam("remapped_name/camera_index", camera_index); // Works
How can I get the parameters in the .cpp file without knowing the node name? Thanks