URDF, Xacro, and TF2
URDF is an XML description of links (rigid bodies) and joints (how links move). Xacro is a macro preprocessor so you do not duplicate the same finger twice and can inject surveyed numbers from YAML.
TF2 is the live transform tree: given joint angles + fixed mounts, robot_state_publisher
broadcasts where every named frame is right now on /tf and /tf_static. Perception,
MoveIt, and placement code query TF instead of hard-coding poses.
Optical frames differ from body frames for cameras (REP-103). Image math uses
*_optical_frame; mechanical mounts use *_camera_link.
Why it matters here
Lane frames are generated from the same YAML that sizes the shelf
(workcell_geometry.yaml), so semantic lane IDs and TF names cannot drift. Grasp candidates
are computed at grasp_center then converted to tool0. Camera topics stamp optical frames.
This project
| Piece | Path |
|---|---|
| Xacro tree | restocker_description/urdf/*.xacro |
| Sim overlay | restocker_gazebo/urdf/restocker_sim.urdf.xacro |
| Sensors | sensors.xacro (wrist RGB-D + optical frame) |
| Contract tests | restocker_description/test/ |
/joint_states ─┐
robot_description ─┴─► robot_state_publisher ─► /tf · /tf_static
├─► perception
├─► MoveIt
└─► placement candidates
Static mounts (world→shelf) rarely change. Arm frames update every joint tick. Never invent
an identity transform to “fix” a missing frame. That hides configuration bugs.
Both branches start at world. Arrows show ancestry; grouped siblings do not form a chain.
References
- Official docs: Building a visual robot model (Jazzy)
- Official docs: Using xacro (Jazzy)
- Official docs: TF2 introduction (Jazzy)
- Literature: REP-103 · REP-105
- Reference implementation:
robot_state_publisher(URDF +/joint_states→ TF) - This project: Workcell and frames · Manipulators and frames