Robot configurations and coordinates
To command a robot you have to write down where it is and where it should go. This chapter shows what "where the robot is" means, and the two kinds of numbers robotics uses to say it.
What a configuration is
The configuration of a robot is a complete description of where every part of it is. Given the configuration, you could draw the robot exactly, every link in its place.
For an arm that description is short. The links are rigid, so they never bend or stretch. Once you know the angle of each joint, every link follows. The configuration is one number per joint.
The fewest numbers that pin down the configuration is the robot's number of degrees of freedom. That is the same count as in the previous chapter, seen from the other side: each degree of freedom is one number you have to write down.
Loading MuJoCo model…
One configuration, written two ways. On the left, six joint angles. On the right, where the tool frame is: three numbers for position and three for orientation. The amber rod is the position, from the base frame to the tool frame.
Joint coordinatesq, one angle per joint
Task coordinatesthe tool frame, in the base frame
Loading the gripper…
Position in metres. Orientation as one axis-angle vector, in radians.
Joint coordinates and task coordinates
The SO-106 has six revolute joints, so six degrees of freedom, and its configuration is six angles. Robotics writes them as a vector q:
q = (shoulder_pan, shoulder_lift, elbow_flex, wrist_flex, wrist_yaw, wrist_roll)
Read a value of q as an instruction for drawing the arm: turn the base by the first angle, tilt the shoulder by the second, and so on out to the wrist. There is a second way to describe the same arm. You could say where the gripper is and how it is turned. That is also six numbers: the same arm, described in different coordinates. Those are the two kinds of coordinates.
The figure is the SO-106, the real MuJoCo model, with the UMI Slim gripper on its flange. Move any joint and both descriptions change together: the six joint angles on the left, and the pose of the tool frame on the right.
Joint coordinates are one number per joint, the vector q. They are the motors' language: each number is something a motor can be told directly. "Bend the elbow 10 degrees" is a command in joint coordinates. The set of every possible q is called joint space, or configuration space.
Task coordinates describe the end effector instead: its position, x, y, z, and its orientation, three more numbers for how it is turned. Together, position and orientation are the hand's pose. They are the task's language. "Put the fingertips five centimetres above the cup, pointing down" is a command in task coordinates. The set of every pose is called task space, or Cartesian space.
| Joint coordinates | Task coordinates | |
|---|---|---|
| Describes | each joint | the end effector |
| Numbers on the SO-106 | 6 angles | 3 for position, 3 for orientation |
| Natural for | motors, logging, replaying a motion | goals in the world, camera-guided motion |
Both describe the same robot, so you can convert from one to the other. That conversion is kinematics, the subject of the next chapter.
Frames
"x = 0.3 metres" only means something once you say from where, and along which direction. A frame answers both: an origin and three axes, glued to some body. In every figure in this course the axes are colored the same way: red is X, green is Y, blue is Z.
Loading MuJoCo model…
Base frame. Fixed to the table under the arm. Task coordinates are written in this frame.
Jointsmove one and watch the frames ride along
Base framein the base frame
Loading the gripper…
How far to move, and how much to turn, to get from the base frame to this one.
The frames you will meet most:
- The base frame is bolted to the table at the foot of the arm. Task coordinates are typically written in this frame.
- A link frame rides on a link and moves with it. The next joint sits at a fixed place in this frame, which is why one angle is enough to place the next link. In the SO-106 model each link frame sits on the joint that moves it, with its Z axis along that joint's axis.
- The tool frame sits at the fingertips. A task-space command asks to put this frame at a pose in the base frame.
- The camera frame sits on the wrist and looks along the fingers. A pixel in the image is a direction in this frame.
A pose is always one frame described in another: how far to move, and how much to turn, to get from the base frame to the tool frame.
Writing down an orientation
A position is three numbers along three axes. An orientation is also three numbers' worth of information, and there are several common ways to write it:
- Axis-angle. Pick the axis you turn around and the angle you turn by. Pack both into one vector of three numbers: its direction is the axis, and its length is the angle in radians. Solarian uses this one.
- Rotation matrix. Nine numbers in a 3×3 grid. Each column is one axis of the turned frame, written in the original frame. Easy to combine: rotating twice is multiplying two matrices.
- Quaternion. Four numbers. Smooth to interpolate between two orientations, and common in simulators and model files.
- Euler angles, such as roll, pitch, and yaw. Three turns about three axes, one after the other. Easy to picture, and the order of the turns matters.
Move and turn the gripper, and watch all four change together. Every orientation is a single turn about some axis, the amber line, starting from the base frame's axes.
Loading MuJoCo model…
The faint arrows are the base frame's axes, carried to the gripper. Roll spins it about the red one, pitch about the green one, and yaw about the blue one. That axis lights up while the lever moves. The amber line is the single turn that lands on the same orientation. Moving a slider stops the animation.
Pose of the gripperits tool frame, in the base frame
Axis-anglewhat Solarian uses
Turn about the axis by the angle. Solarian packs both into one vector, the axis scaled by the angle in radians: rx, ry, rz.
Rotation matrixnine numbers
Each column is one axis of the tool frame, written in the base frame. Its colors match the arrows.
Quaternionfour numbers
w is the cosine of half the angle. x, y, z are the axis, scaled by the sine of half the angle.
Euler anglesthree turns
The same orientation, written as roll about the base X, then pitch about the base Y, then yaw about the base Z. Releasing a lever leaves these angles.
All four describe the same physical rotation, and libraries convert between them. Pick the one your tool expects.
In Solarian
Each joint is one actuator on the module, so the six servo lines from the previous chapter are the arm's joint coordinates. A joint command is a number from −100 to 100, where 0 is the middle of the joint's travel. Calibration, in Tutorial 3, teaches each servo where its ends are. In Tutorial 2 the keyboard nudges these numbers one joint at a time.
Task coordinates arrive in Tutorial 4, when a skill needs to name a pose. The arm module gains six more actuators, one per task coordinate:
so106/modules/right_arm.py
from solarian.core.arm_module import ArmModule
from solarian.core.ik import CartesianIKActuator
from solarian_feetech.actuator import FeetechServo
class RightArmModule(ArmModule):
# Joint coordinates: one per servo.
shoulder_pan = FeetechServo(model="sts3250")
shoulder_lift = FeetechServo(model="sts3250")
elbow_flex = FeetechServo(model="sts3250")
wrist_flex = FeetechServo(model="sts3250")
wrist_yaw = FeetechServo(model="sts3215")
wrist_roll = FeetechServo(model="sts3215")
# Task coordinates: position in metres, rotation as axis-angle in radians.
x = CartesianIKActuator()
y = CartesianIKActuator()
z = CartesianIKActuator()
rx = CartesianIKActuator()
ry = CartesianIKActuator()
rz = CartesianIKActuator()
x, y, and z are the position of the hand in the base frame. rx, ry, and rz are one axis-angle vector, the orientation.
Declaring the task coordinates as CartesianIKActuators is all it takes to work with the arm in task space, in both directions:
- Read them, and the module runs forward kinematics on the current joint angles, so every observation carries the hand's pose next to the joints.
- Write them, and the module runs inverse kinematics and sends the six joint commands, so a skill moves the arm by naming where the hand should go.
Now is time to understand how to translate between joint coordinates and task coordinates.
Next: kinematics.