Closed Shenwei0 closed 8 months ago
Hi @Shenwei1234 and thank you for the question. When you run the lbr_bringup
or lbr_ros2_control
packages, e.g.
ros2 launch lbr_bringup bringup.launch.py # model specifications / simulation etc.
The joint_state_publisher
and the robot_state_publisher
nodes will be launched. The robot_state_publisher
publishes using tf2
.
You can find this in the launch files:
A more minimal version of this is in the lbr_ros2_control
package: https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/humble/lbr_ros2_control/launch/system_interface.launch.py
Hope this answers the question. Let me know if this helps.
Thanks for the reply:). If I understand correctly, the joint_state_publisher publishes the robot's joint states using tf2. But to which topic does it publish to, and who is subscribed/listener to the published joint states? Also, what's the difference between joint_state_publisher and robot_state_publisher? What does robot_state_publisher do?
no problem. So the joint_state_publisher
is part of ros2_control
. It reads joint states from the hardware and publishes under /joint_states
.
The robot_state_publisher
subscribes to /joint_states
. Given the URDF and joint states, the robot_state_publisher
computes kinematics and publishes the transforms to /tf
.
I understand now. Thanks again:)
okay great, hopefully it is okay to close this issue for now? Please feel free to ask any other questions or re-open.
Do you use tf2 for managing all the coordinate frames, and if so how?