Understanding joint state publisher
Joint state publisher is one of the ROS packages that is commonly used to interact with each joint of the robot. The package contains the joint_state_publisher node, which will find the nonfixed joints from the URDF model and publish the joint state values of each joint in the sensor_msgs/JointState message format.
In the preceding launch file, view_arm.launch, we started the joint_state_publisher node and set a parameter called use_gui to true, as follows:
<param name="use_gui" value="true"/> <!-- Starting Joint state publisher node which will publish the joint values --> <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
If we set use_gui to true, the joint_state_publisher node displays a slider-based control window to control each joint. The lower and upper value of a joint will be taken from the lower and upper values associated with the limit tag used inside the joint tag. The preceding screenshot shows the robot model in RViz, along with a user interface to change the position of robot joints, which states with the use_gui parameter set to true.
We can find more on the joint state publisher package at http://wiki.ros.org/joint_state_publisher.