0
$\begingroup$

Rosanswers logo

LINK TO TUTORIAL

I am trying to figure out how to publish my robot's state using the 'robot_state_publisher'. I fortunately found the tutorial linked to above, but unfortunately the author was rather vague in their example of a launch file (copied below from the tutorial).

<launch>
    <node pkg="robot_state_publisher" type="robot_state_publisher" name="rob_st_pub" >
        <remap from="robot_description" to="different_robot_description" />
        <remap from="joint_states" to="different_joint_states" />
    </node>
</launch>

I would like to know if anyone can better explain what the difference is between 'robot_description' and 'different_robot_description' and exactly what information these are supposed to contain.


Originally posted by RigorMortis on ROS Answers with karma: 88 on 2014-06-03

Post score: 4

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I managed to figure it out.

The 'remap' command seems to change parameters that the node uses 'from' some original value 'to' a new value specified by the user. In this case, the 'from' parts are correct, but the 'to' parts need to be changed to reflect your particular robot. For example, if your robot's joint_states are being published to /myrobot/joint_states, and if you load your URDF to the parameter server with this line:

<param name="myrobot" textfile="$(find mypackage)/urdf/myrobot.urdf" />

And then you should write the robot state publisher node as below:

<launch>
    <node pkg="robot_state_publisher" type="state_publisher" name="rob_st_pub" >
        <remap from="robot_description" to="myrobot" />
        <remap from="joint_states" to="myrobot/joint_states" />
    </node>
</launch>

*Note that there was also a mistake in the 'node' line of the launch file that I have corrected. I can't be certain that this is correct for all ROS versions, but I can verify that it works on ROS Fuerte perfectly.


Originally posted by RigorMortis with karma: 88 on 2014-06-03

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by JoSo on 2014-07-03:
Hey, I'm a noobie trying this same tutorial. are you setting the <param ... /> within that launch file? I would like to use my custom arm robot urdf with the joint state publisher so I can manipulate the arm in Rviz using the interactive markers. Any thoughts?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.