there are already many URDF files preinstalled

sudo apt install ros-jazzy-urdf-tutorial
cd /opt/ros/jazzy/share/urdf_tutorial/urdf
**/opt/ros/jazzy/share/urdf_tutorial/urdf$ ls**
01-myfirst.urdf         03-origins.urdf    05-visual.urdf    07-physics.urdf
02-multipleshapes.urdf  04-materials.urdf  06-flexible.urdf  08-macroed.urdf.xacro

Launch the URDF files

ros2 launch urdf_tutorial display.launch.py model:=/opt/ros/jazzy/share/urdf_tutorial/urdf/07-physics.urdf
ros2 launch urdf_tutorial display.launch.py model:=/opt/ros/jazzy/share/urdf_tutorial/urdf/05-visual.urdf 
~$ ros2 node list
/joint_state_publisher
/robot_state_publisher
/rviz
/transform_listener_impl_55d178d34db0
~$  ros2 topic list
/joint_states
/parameter_events
/robot_description
/rosout
/tf
/tf_static

image.png

key terminologies

Instead of computing the transformations ourselves, we use the ROS TF functionality, with the tf2 library. TFs are published on the /tf topic.

**~$ ros2 topic echo /tf**

transforms:
- header:
    stamp:
      sec: 1742282856
      nanosec: 517590047
    frame_id: base_link
  child_frame_id: gripper_pole
  transform:
    translation:
      x: 0.19
      y: 0.0
      z: 0.2
    rotation:
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0
- header:
    stamp:
      sec: 1742282856
      nanosec: 517590047
    frame_id: base_link
  child_frame_id: head
  transform:
    translation:
      x: 0.0
      y: 0.0
      z: 0.3
    rotation:
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0

Visualizing the TF tree