lbr-stack / lbr_fri_ros2_stack

ROS 1/2 integration for KUKA LBR IIWA 7/14 and Med 7/14
https://lbr-stack.readthedocs.io/en/latest/
Apache License 2.0
121 stars 34 forks source link

Use of tf2 trees #132

Closed Shenwei0 closed 8 months ago

Shenwei0 commented 8 months ago

Do you use tf2 for managing all the coordinate frames, and if so how?

mhubii commented 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.

Shenwei0 commented 8 months ago

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?

mhubii commented 8 months ago

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.

Shenwei0 commented 8 months ago

I understand now. Thanks again:)

mhubii commented 8 months ago

okay great, hopefully it is okay to close this issue for now? Please feel free to ask any other questions or re-open.