Understanding robot state publisher

The robot state publisher package helps to publish the state of the robot to tf. This package subscribes to joint states of the robot and publishes the 3D pose of each link using the kinematic representation from the URDF model. We can implement the robot state publisher node using the following line inside the launch file:

<!-- Starting robot state publish which will publish tf --> 
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" /> 

In the preceding launch file, view_arm.launch, we started this node to publish the tf of the arm. We can visualize the transformation of the robot by clicking the tf option on RViz, shown as follows:

Figure 11: TF view of seven DOF arm ...

Get Mastering ROS for Robotics Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.