ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

What did the author of the "Using the robot state publisher on your own robot" tutorial intend by their launch file example?

asked 2014-06-03 10:01:51 -0500

RigorMortis gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-06-03 11:28:27 -0500

RigorMortis gravatar image

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.

edit flag offensive delete link more

Comments

Hey, I'm a noobie trying this same tutorial. are you setting the 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?

JoSo gravatar image JoSo  ( 2014-07-03 14:12:18 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-06-03 10:01:51 -0500

Seen: 1,730 times

Last updated: Jun 03 '14