Theme
Stage 2 · lesson 2 of 6 · 35 min

One source of physical truth

You will: Keep every number about the robot in exactly one place, including the ones you did not write.

Builds on A robot is a tree.

The usual way to write a robot description is to type numbers into XML. The usual result is the same number in four places, three of them stale. The rule here is that every number has exactly one home — and for the SO-101 that rule decides something unexpected: the home of most of its numbers is not this repository.

Its kinematic truth is upstream's URDF: TheRobotStudio's file, fetched unmodified and pinned to one commit. Its link lengths, joint origins, axes and position limits are theirs. Copying them into a file of our own would create a second copy that could disagree with the first, with nothing to say which was right.

So so101_follower.yaml is an overlay. It restates no link length, origin or axis. It adds only what a URDF has no place for:

in the profile why
which joints are the arm, and which is the gripper nothing in a URDF says so
how far the jaw opens and closes in radians, because the jaw is revolute
named poses five numbers each, one per arm joint
the servo's datasheet figures upstream's effort limits are placeholders
the execution targets mock, gz and feetech

One function, describe(), puts the two together at launch, in memory. The file in vendor/ is never edited. Everything above it — the launch files, the client that drives the controllers, the scenarios — reads joints, poses and the tool frame from the profile, so none of them names this robot. A different arm is a different profile, not an edit to code.

The rejected alternatives are worth knowing, because both look reasonable. Copying upstream's URDF into this repository and editing it creates a fork that silently stops matching the arm when upstream fixes something. And a script that generates a URDF and commits it creates a second artefact that drifts: someone eventually edits the generated file, and every consistency test becomes meaningless.

The figures the overlay does carry say where they came from. The servo's have a provenance field, datasheet today, and a test requires it. The joint friction is marked as an estimate, and each servo's calibration as an assumption, because those are facts about an assembled arm and none has been measured yet. The file says so in the data, rather than in a comment nobody reads.

In the simulation

This page follows the same rule. It reads upstream's URDF for the joints and their limits, and the profile for the named poses and the jaw, and types none of them itself. The pose buttons are the overlay; where each slider stops is upstream.

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. Send the arm to ready with its button under the joints. Those five numbers live in the overlay, nowhere else.
  2. Drag shoulder_lift to its upper limit, +100°. That stop is upstream's upper, which the overlay never restates.
  3. Send it to place, another pose from the profile.
  4. Open Inspect, on its /joint_states view, and read place back as five positions in radians.

Do it

  1. Open the overlay and find three things: the list of arm joints, a named pose, and a provenance line. Then look for a link length, and notice there is none.

    less src/threevn_robot_description/config/so101_follower.yaml
    
  2. Read the test that keeps it that way.

    grep -n -A15 "def test_it_restates_no_kinematics" src/threevn_robot_description/test/test_so101_profile.py
    

    Expect: Each joint entry may say which servo drives it, its bus id and its calibration, and nothing else. Geometry and limits belong to upstream.

  3. Compare upstream's joint origins with the ones that actually run.

    diff -w <(grep -A1 'type="revolute"' vendor/so101/so101.urdf | grep "<origin") \
            <(make urdf 2>/dev/null | grep -A1 'type="revolute"' | grep "<origin")
    echo "exit status: $?"
    

    Expect: No differences and exit status: 0. The overlay never moves a joint.

  4. Now compare the limits.

    diff -w <(grep "<limit" vendor/so101/so101.urdf) \
            <(make urdf 2>/dev/null | grep "<limit")
    

    Expect: Six changed lines, and only effort and velocity differ. Every lower and upper is upstream's, untouched. Upstream says how far a joint may go; this project says how hard and how fast its servo can drive it. A later lesson in this stage is about where those two numbers come from.

You will know it worked when: You can point to where each kind of number about the SO-101 lives, upstream or overlay, and show from the diffs that the overlay changes what the motors can do and never where the joints are.

When it goes wrong

You edited vendor/so101/so101.urdf and the change vanished.

Why: vendor/ is fetched, not committed, and make so101-fetch overwrites it. A test also checks that the overlay never modifies the upstream file.

Fix: Put the change in the overlay if it is something a URDF has no place for. If it is geometry, it belongs upstream: take a newer pinned commit rather than editing a local copy.

PROFILE= names a new file you just created, and it is not found.

Why: A new file has no installed symlink until the workspace is rebuilt.

Fix: Run make build once after adding a profile.

Terms

xacro
The macro language robot descriptions are written in. It expands into plain URDF, and here it reads its numbers from YAML with xacro.load_yaml().
Profile
One YAML file holding every physical number for one robot. Swap the file, get a different robot; no model file changes.
Provenance
Where a number came from — measured, datasheet, estimated or computed — recorded next to it and required by a test.

Every term in the course: glossary.

Check yourself

Answer in your head first, then open it.

Why does the SO-101's profile not simply copy upstream's link lengths, so that everything is in one file?

Then there would be two copies of the same geometry, upstream's and ours, and a newer upstream commit could change one without the other. Nothing would say which was right.

The overlay changes effort and velocity but never lower and upper. Why that split?

Where a joint stops is a fact about the printed parts, which upstream designed. How hard and how fast it can be driven is a fact about the servos and the supply, which upstream left as placeholders.

Stretch

Read scripts/fetch_so101.sh and its comment on pinning. Suppose upstream renames elbow_flex to elbow tomorrow. List everything in this repository that would break if the fetch followed upstream's main, and say which test would tell you first now that it is pinned.

Going deeper