$\color{white}\colorbox{FE9227}{Approaching a well-rounded comprehension of the subject matter!}$
$$▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░ 57.2%
The Robot State Publisher is the node that translates the information defined in your urdf
and xacro
files and publishes those joints
and links
to the tf2
tree. The robot_state_publisher
creates a topic, in the namespace of the robot, called /robot_description
which can be subscribed to to retrieve information about the robot.
<aside>
⚠️ The robot state publisher is only able to publish the tf2
transforms of fixed joints. To publish the joint_states
for moving joints you will need to add controller plugins.
</aside>
In order for the Robot State Publisher to publish information about your robot to it’s published topics, it first needs to receive an input argument describing your robot. The input argument in this case, populated in the parameters
field of the launch file, is the full XML of your robot urdf
.
To pass this description parameter to the Node, use the following syntax:
parameters=[{"robot_description" : robot_urdf}]
The Robot State Publisher has three published topics.
robot_description
(std_msgs/msg/String
) - The description of the robot URDF as a string. Republishes the value set in the robot_description
parameter, which is useful for getting informed of dynamic changes to the URDF. Published using the “transient local” quality of service, so subscribers should also be “transient local”.tf
(tf2_msgs/msg/TFMessage
) - The transforms corresponding to the moveable joints of the robot.tf_static
(tf2_msgs/msg/TFMessage
) - The transforms corresponding to the static joints of the robot.joint_states
(sensor_msgs/msg/JointState
) - The joint state updates the robot poses. The RobotStatePublisher class takes these updates, do transformations (such as mimic joints), and then publish the results on the tf2 topics.
robot_description
(string) - The original description of the robot in URDF form. This must be set at robot_state_publisher startup time, or the node will fail to start. Updates to this parameter will be reflected in the robot_description
topic.publish_frequency
(double) - The maximum frequency at which non-static transforms (e.g. joint states) will be published to /tf
. Defaults to 20.0Hz.