Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficult to remap paramter name passed to initParam #20

Open
sloretz opened this issue Jul 6, 2018 · 0 comments
Open

Difficult to remap paramter name passed to initParam #20

sloretz opened this issue Jul 6, 2018 · 0 comments

Comments

@sloretz
Copy link
Contributor

sloretz commented Jul 6, 2018

It can be difficult to remap the parameter name passed to initParam (usually robot_description). This may be due to the call to searchParam().

urdf/urdf/src/model.cpp

Lines 96 to 99 in 4707296

if (!nh.searchParam(param, full_param)){
ROS_ERROR("Could not find parameter %s on parameter server", param.c_str());
return false;
}

This appears to work

<?xml version="1.0"?>
<launch>
  <param name="robot_description" type="str" value="Dummy value to trick searchParam"/>

  <node pkg="robot_state_publisher" name="private_robot_state_pub" type="robot_state_publisher">
    <remap from="/robot_description" to="~/robot_description"/>
    <param name="~/robot_description" type="str" value="&lt;robot name=&quot;private_robot&quot;&gt;&lt;link name=&quot;private_link&quot;/&gt;&lt;/robot&gt;"/>
  </node>
</launch>

And these result in the following error

[ERROR] [1530889965.789570642]: Could not find parameter robot_description on parameter server

no dummy global parameter

<?xml version="1.0"?>
<launch>
  <node pkg="robot_state_publisher" name="private_robot_state_pub" type="robot_state_publisher">
    <remap from="/robot_description" to="~/robot_description"/>
    <param name="~/robot_description" type="str" value="&lt;robot name=&quot;private_robot&quot;&gt;&lt;link name=&quot;private_link&quot;/&gt;&lt;/robot&gt;"/>
  </node>
</launch>

dummy parameter, but non-FQN in remap rule

<?xml version="1.0"?>
<launch>
  <param name="robot_description" type="str" value="Dummy value to trick searchParam"/>

  <node pkg="robot_state_publisher" name="private_robot_state_pub" type="robot_state_publisher">
    <remap from="robot_description" to="~/robot_description"/>
    <param name="~/robot_description" type="str" value="&lt;robot name=&quot;private_robot&quot;&gt;&lt;link name=&quot;private_link&quot;/&gt;&lt;/robot&gt;"/>
  </node>
</launch>

Motivated by ros/robot_state_publisher#89

dreuter pushed a commit to dreuter/urdf that referenced this issue Jun 2, 2022
* Enable warnings

Signed-off-by: Audrow Nash <[email protected]>

* Remove move in function return

Signed-off-by: Audrow Nash <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant