Theme
Stage 2 · lesson 4 of 6 · 30 min

Frames that save you a day each

You will: Place the frames later phases assume, and read any transform between them on a live robot.

Builds on A robot is a tree.

Every link carries a coordinate frame, and ROS keeps them all in one time-indexed tree called TF. Ask "where was the gripper relative to the camera 0.3 seconds ago" and TF answers, interpolating if it must. In this project exactly one thing writes the robot's frames to it, robot_state_publisher, which reads the description and the live joint positions. Nothing else ever publishes a transform by hand.

A few frames earn their keep long before anything uses them:

  • A fixed root. The SO-101's is world, joined to base_link by a fixed joint: the bench clamp. A robot that drives would put a weightless base_footprint on the ground instead, so attaching a base is one joint rather than a restructuring. This arm is bolted down, so it needs no such frame.
  • A tool frame. Every inverse-kinematics solver and motion planner asks for one. Many robots call it tool0; the SO-101's is upstream's gripper_frame_link, at the tip of the fixed jaw. Its name is written once, in the profile, and the client, the scenarios and the tests read it from there, so none of them hard-codes it.
  • A camera optical frame, separate from the camera's body frame. This description has no camera yet. Tier 6 adds one, and this is the frame to get right when it does.

That last one is the day-saver. Cameras and robots disagree about axes: robot bodies use x forward, z up; the optical convention is z forward, x right, y down. A fixed joint carrying exactly that rotation — roll −90°, yaw −90° — lets each side keep its own convention. Getting it wrong is the commonest perception bug there is: everything runs, the rate is right, the numbers look plausible, and the arm reaches 90° away from the object.

One thing will look broken in Gazebo later, so know it now: Gazebo merges links joined by fixed joints, so a fixed frame such as the tool frame may not exist there at all. That does not matter, because TF comes from the description, not from Gazebo.

In the simulation

tf2_echo base_link gripper_frame_link, live. The inspector's tf view prints what it would, from the same description, as the arm moves.

Kinematic: joints move at their real speed limit, but there is no gravity, no load and no physics. That is what the steps below are for.

The SO-101 loads as you reach it.

In this lesson

  1. Open Inspect, then its tf view, and home the arm with h or the home button. Read where the tool is.
  2. Swing shoulder_pan positive until the tool is 10 cm to the arm's right, y below −0.10.
  3. Reach out and down. Put the tool 25 cm or more in front of the base along x, and within 5 cm of the bench.
  4. Turn on Frames and find the tool frame's axes at the tip of the fixed jaw.

Do it

  1. Start the viewer, and open http://localhost:8106/vnc.html.

    make view
    
  2. Find where the tool frame and the base frame are named.

    grep -n -E "base_frame|tool_frame" src/threevn_robot_description/config/so101_follower.yaml
    

    Expect: base_frame: base_link and tool_frame: gripper_frame_link. The scenarios and the robot client read these instead of typing a frame name.

  3. In a second terminal, confirm the root of the tree.

    make shell
    ros2 run tf2_ros tf2_echo world base_link
    

    Expect: Zero translation and zero rotation. This transform is the bench clamp, and it is the same on every target.

  4. Read where the tool is, then move shoulder_pan in the slider window and read it again.

    ros2 run tf2_ros tf2_echo base_link gripper_frame_link
    

    Expect: With every slider at zero, the jaw tip about 0.39 m out along x and 0.23 m up. Drag shoulder_pan positive and y goes negative: the arm swings to its right.

You will know it worked when: You can read the transform from world to gripper_frame_link on the running SO-101, and say where its tool frame is named and why nothing else names it.

When it goes wrong

tf2_echo base_link tool0 waits forever and prints nothing.

Why: The SO-101 has no tool0. Its tool frame is upstream's gripper_frame_link.

Fix: Check names against `make urdf | grep "

tf2_echo waits forever for any pair of frames.

Why: Nothing is publishing TF, because the viewer is not running.

Fix: Keep make view running in the first terminal.

Terms

TF
ROS's time-indexed tree of coordinate frames. Here, robot_state_publisher is the only thing that writes to it.
Optical frame
The camera convention — z forward, x right, y down — kept in a frame separate from the camera body, joined by a fixed rotation.
tool0
The conventional name for the arm's tool flange, expected by motion planners and inverse-kinematics code.
REP-103 and REP-105
The ROS conventions for units and axis directions, and for the standard frames a mobile robot has (base_link, odom, map).

Every term in the course: glossary.

Check yourself

Answer in your head first, then open it.

The SO-101 has no base_footprint. Why does it not need one?

base_footprint exists so a mobile base can be attached with one joint. The SO-101 is clamped to a bench, so its root is world and the clamp is that one joint.

Why is the tool frame named in the profile rather than written into the scenarios as gripper_frame_link?

The scenarios are not the SO-101's: they also drive the project's other profiles, whose tool frames have different names. Named once, in each robot's profile, the scenarios work on every robot and no robot's frame name leaks into the code.

Stretch

The SO-101 will get a wrist camera. Sketch the two frames it needs, camera_link and camera_optical_frame, with the fixed rotation between them. Then decide where they should live. The overlay restates no geometry, and a camera mount is geometry that upstream did not design. What does that leave?

Hint

Upstream published a wrist-camera variant of its URDF in September 2026. Compare pinning a different upstream file with adding a mount to the overlay.

Going deeper