Skip to main content

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​

PiecePath
Xacro treerestocker_description/urdf/*.xacro
Sim overlayrestocker_gazebo/urdf/restocker_sim.urdf.xacro
Sensorssensors.xacro (wrist RGB-D + optical frame)
Contract testsrestocker_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.

Coordinate frame tree · world (metres, REP-103)

Both branches start at world. Arrows show ancestry; grouped siblings do not form a chain.

Robot branch
rail_base → carriage → base_linkprismatic rail + UR10e root
shoulder_link → … → wrist_3_link → tool0official ur_description chain
tool0 children: gripper · wrist_camera_linkgripper → grasp_center / fingers; camera → optical frame
Shelf branch
shelfstatic world → shelf transform
Separate children of shelf
lane_01 … lane_06six sibling frames · +Y downhill
roller_bedfixed shelf child
overhead_camera_linkfixed shelf child
overhead_camera_optical_framechild of camera link · image stamps
RootStructureKinematics / sensorsEnd-effector

References​