Day 9

URDF, Xacro, and the robot description model

This is a valid v1.0 placeholder page for the later curriculum arc. Full interactive lab treatment ships after Week 1 dogfooding.

LECTURE & READING

Glossary primer (10 min)

  • URDF (Unified Core ConceptsRobotA physical system with sensors and actuators that can observe the world and take actions. Description Format) — XML schema describing a Core ConceptsRobotA physical system with sensors and actuators that can observe the world and take actions.'s links, joints, visual meshes, collision meshes, and inertia.
  • Movement, Mechanics & Robot BodyLinkA rigid body segment between joints. — A rigid body. Has <visual> (for rendering), <collision> (for physics), <inertial> (mass, inertia tensor).
  • Movement, Mechanics & Robot BodyJointA movable connection between robot parts. — Connects two links. Types: fixed, revolute, continuous, prismatic, planar, floating.
  • Xacro — Macro language on top of URDF. Adds <xacro:property>, <xacro:macro>, <xacro:include>. Expands to plain URDF at runtime.
  • TF (tf2) — ROS 2's transform library; broadcasts and listens to coordinate frames over /tf and /tf_static.
  • `Core ConceptsRobotA physical system with sensors and actuators that can observe the world and take actions._Core ConceptsStateThe robot’s current condition, such as joint positions, velocity, object positions, or internal variables._publisher` — Node that reads URDF + Movement, Mechanics & Robot BodyJointA movable connection between robot parts. states and broadcasts the full TF tree.
  • `Movement, Mechanics & Robot BodyJointA movable connection between robot parts._Core ConceptsStateThe robot’s current condition, such as joint positions, velocity, object positions, or internal variables._publisher_gui` — Node with sliders for each non-fixed Movement, Mechanics & Robot BodyJointA movable connection between robot parts.. Fakes Movement, Mechanics & Robot BodyJointA movable connection between robot parts. states for visualization.
  • RViz 2 — ROS 2's 3D visualization tool.
  • MJCF (review) — MuJoCo's equivalent. Some robots ship with both; the URDF may not be physics-accurate.

Real-world analogy

URDF is a Lego instruction manual: it lists every brick (Movement, Mechanics & Robot BodyLinkA rigid body segment between joints.), how each connects (Movement, Mechanics & Robot BodyJointA movable connection between robot parts.), and what each looks like (mesh). Xacro is the "parametric" version — instead of writing six identical instructions for the six bolts, you write one macro and call it six times.

Hour 1 — Reading + watch

Hour 2 — Inspect the Panda URDF

The Franka Panda has both a URDF (from Franka Robotics) and an MJCF (in MuJoCo Menagerie). Get the URDF:

sudo apt install -y ros-jazzy-franka-description
ls /opt/ros/jazzy/share/franka_description/

Expected:

end_effectors  meshes  package.xml  robots  rviz
  • Open /opt/ros/jazzy/share/franka_description/robots/panda/panda.urdf.xacro in your editor. Read for ~25 min. Identify:
  • The base Movement, Mechanics & Robot BodyLinkA rigid body segment between joints. <link name="panda_link0">.
  • The 7 revolute joints panda_joint1 through panda_joint7, each with <axis>, <limit lower=... upper=...>, <dynamics damping=...>.
  • The hand and finger links.
  • Where Xacro macros expand Movement, Mechanics & Robot BodyLinkA rigid body segment between joints. properties.

LAB

Hour 3 — Lab: build your own 3-link arm + visualize in RViz (75 min)

What you're building. A self-contained URDF for a 3-link planar manipulator (pretend hobby arm), launched in RViz with joint_state_publisher_gui so you can drag sliders and watch the model move. You'll then enhance it with Xacro by parameterizing the Movement, Mechanics & Robot BodyLinkA rigid body segment between joints. lengths.

What success looks like at the end. You have: 1. w2-systems/urdf/three_link_arm.urdf.xacro — Xacro file with three <link> and three <joint> elements. 2. w2-systems/launch/three_link_view.launch.py — Python launch file. 3. RViz window showing your arm, with a Control & PlanningControlThe method used to make the robot move the way you want. panel of three sliders. Dragging slider 1 rotates the whole arm; slider 2 bends the elbow; slider 3 wags the wrist. 4. Screenshot figures/day9_three_link_arm.png.

Step 1 — Scaffold the package (5 min)

cd ~/robo47/w2-systems/ros2_ws/src
ros2 pkg create three_link_desc --build-type ament_cmake --dependencies urdf xacro
cd three_link_desc
mkdir -p urdf launch rviz

Full source continues in the committed curriculum files. The v1.0 page exposes the day flow and lab surface without inventing content.

Completion controls unlock when this day graduates from placeholder to full lab.