urdf
urdf copied to clipboard
Difficult to remap paramter name passed to initParam
It can be difficult to remap the parameter name passed to initParam
(usually robot_description
). This may be due to the call to searchParam()
.
https://github.com/ros/urdf/blob/470729633ba0419735603a054fec0b5bbfe442f9/urdf/src/model.cpp#L96-L99
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="<robot name="private_robot"><link name="private_link"/></robot>"/>
</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="<robot name="private_robot"><link name="private_link"/></robot>"/>
</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="<robot name="private_robot"><link name="private_link"/></robot>"/>
</node>
</launch>
Motivated by ros/robot_state_publisher#89