Theme
Stage 2 · lesson 1 of 6 · 30 min

A robot is a tree

You will: Read a robot description as links and joints, and predict how each joint moves.

A robot description — URDF, the Unified Robot Description Format — is a tree. Each node is a link: a rigid body with a shape you see, a shape that collides, and a mass. Each edge is a joint: how a child link moves relative to its parent. If you have built a scene graph or nested coordinate transforms, you already have the model; a joint is a transform with one variable in it.

Four joint types cover nearly everything:

type moves on the SO-101
revolute rotates, between limits all six moving joints
continuous rotates forever none: it is how a wheel is described
prismatic slides, between limits none: it is how a sliding finger is described
fixed not at all the bench clamp, and the tool frame

The SO-101 is five rotating arm joints and a jaw:

joint what it does range
shoulder_pan swings the arm left and right ±110°
shoulder_lift raises and lowers the upper arm ±100°
elbow_flex bends the elbow ±97°
wrist_flex tilts the gripper up and down ±95°
wrist_roll turns the gripper about its own axis −157° … +163°
gripper swings the jaw open −10° … +100°

The elbow bends both ways, which is less common on small arms than it sounds. Remember it: it matters in Tier 6, when the arm has to reach down to the bench.

The jaw is revolute too. One jaw swings against a fixed one, so its positions are radians, not millimetres, and one joint describes it. A gripper with two moving fingers on one motor would need a mimic joint, one that copies another's position; this one does not.

Its root is world, which upstream's file does not have. This project adds it because an unclamped 632 g arm topples the first time a joint moves, and a real SO-101 is clamped to a bench. The fixed joint is the clamp.

And "tree" is a real constraint, not a metaphor. A description has exactly one root and no loops — which is why a parallel linkage, a mechanism with a closed loop in it, cannot be described directly.

In the simulation

The same six joints as make view, in this page, with nothing to install. Predict before you move: every slider stops at its joint's limit.

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. Turn on Frames, or press f. Each joint's own axes appear; its axis is the blue one, z.
  2. Predict which way a positive shoulder_pan swings the arm. Then drag it to its upper limit.
  3. Bend the elbow as far as it goes one way.
  4. Now as far as it goes the other way. It bends both ways.
  5. Roll the wrist to its lower limit. Its range is not symmetric.
  6. Drag the jaw's slider open to its upper limit, +100°.

Do it

  1. Print the expanded description and look at its shape.

    make urdf 2>/dev/null | head -80
    

    Expect: world, the fixed joint that clamps base_link to it, then <link> blocks whose visuals are upstream's meshes and whose collisions are plain boxes.

  2. List every joint and its type.

    make urdf 2>/dev/null | grep '<joint name=.*type='
    

    Expect: Six revolute joints and two fixed ones: world_to_base_link, and gripper_frame_joint for the tool frame.

  3. Read every joint's axis.

    make urdf 2>/dev/null | grep '<axis'
    

    Expect: 0 0 1 for all six moving joints, and 0 0 0 for the fixed one. They do not all turn the same way: an axis is written in the joint's own frame, and each joint's <origin rpy=...> rotates that frame first.

  4. Read the limits, in radians.

    make urdf 2>/dev/null | grep -B6 '<limit' | grep -E 'joint name|<limit'
    

    Expect: From the jaw back to the base: gripper −0.17 to 1.75 (−10° to +100°), wrist_roll −2.74 to 2.84, wrist_flex ±1.66, elbow_flex ±1.69, shoulder_lift ±1.75, shoulder_pan ±1.92.

  5. Look at it. Start the viewer, then open http://localhost:8106/vnc.html in a browser.

    make view
    

    Expect: RViz with upstream's meshes, and a window of six joint sliders.

  6. Before dragging each slider, predict which way the arm will move. Then drag it. Start with shoulder_pan: does a positive value swing the arm to its left or to its right?

    Expect: Positive shoulder_pan swings it to its right, toward negative y. That joint's origin is rotated half a turn, so its 0 0 1 axis points down. Every slider stops at its limit.

You will know it worked when: You can name each of the SO-101's joints with its type and range, and predict which way it moves before you drag its slider.

When it goes wrong

The browser page stays on "Connecting" or is blank.

Why: The container is not running, or another process holds port 8106.

Fix: make up, then check the port with lsof -nP -iTCP:8106 -sTCP:LISTEN.

make urdf prints nothing, or fails on a missing so101.urdf.

Why: The upstream description has not been fetched. It is not committed to this repository.

Fix: Run make so101-fetch once.

Terms

URDF
Unified Robot Description Format — the XML tree of links and joints that every ROS tool reads to know what the robot is.
A rigid body in a robot description, with a visual shape, a collision shape and an inertial (mass) block.
Joint
The connection between a parent and a child link, with a type — revolute, continuous, prismatic or fixed — an axis and limits.
Mimic joint
A joint that copies another's position, scaled and offset. How one servo drives two gripper fingers; the SO-101's single jaw needs none.
Degrees of freedom (DOF)
The number of independent ways a robot can move. The SO-101 has five, plus a jaw.

Every term in the course: glossary.

Check yourself

Answer in your head first, then open it.

Every moving joint's axis is 0 0 1. How can they turn in different directions?

The axis is expressed in the joint's own frame, and the joint's origin rotates that frame relative to the parent link. The direction of motion is the axis and the origin together; neither alone tells you.

The SO-101's gripper has one actuated joint and no mimic. Why does it not need one?

Only one jaw moves. It swings against a jaw that is part of the gripper link, so there is no second part to copy the first.

Why does this project add a world link that the upstream file does not have?

Without it base_link is a free body, and a simulated arm with nothing holding it down topples as soon as a joint moves. The fixed joint is the bench clamp.

Stretch

From the make urdf output alone, sketch the chain from world to gripper_frame_link. Then check it against the running robot: with make view up, open make shell and run ros2 run tf2_ros tf2_echo base_link gripper_frame_link. Move shoulder_lift and watch the numbers change.

Going deeper