Visual explainer
Coordinate Frames and Transforms
Convert coordinates across sensor and robot frames using homogeneous transformation matrices in SE(2) and SE(3).
Coordinates describe a point relative to a declared frame. A rigid transform changes that description through rotation and an origin offset, preserving physical distances. We use column vectors and write for a map from camera frame C into base frame B; the right subscript is the input frame.
1. One Point, Two Frames
The mint dot is one physical point P. Base x points right and base y up. The camera frame is rotated −90° in the plane, so camera x points down and camera y right. In this synthetic fixture its origin is at (0.80, 0.50) m in B. P has coordinates (0.10, 0.40) m in C and (1.20, 0.40) m in B. Changing coordinates does not move the object. This planar C frame is a teaching frame, not a complete optical-axis convention.
2. First Align The Axes
This control case temporarily sets the camera rotation to zero while retaining offset t = (0.80, 0.50) m and local point (0.10, 0.40) m. Parallel axes allow direct addition: m. The head-to-tail path adds offset and local displacement; the dashed route is the total displacement. It uses 240 drawing units per metre. The different output is intentional: this is a different frame orientation from the main example.
3. Rotate Without Rescaling
Now isolate the main example's −90° rotation at a common origin. At 300 drawing units per metre, the vector (0.10, 0.40) becomes (0.40, −0.10). Both lengths are m. The dashed circular arc makes the preserved radius visible. The plot shows the numerical rotation operation in a common chart; it does not move the real target.
R( heta)=egin{bmatrix}cos heta&-sin heta\sin heta&cos hetaend{bmatrix},qquad R(-90^circ)=egin{bmatrix}0&1\-1&0end{bmatrix}.Rotation columns are orthogonal unit axes, with determinant +1 and . Modern Robotics 3.2.1 distinguishes representing a frame from actively rotating a vector; keeping the input/output frame labels avoids mixing those interpretations.
4. Distinguish Points From Directions
The white arrow is the rotated direction (0.40, −0.10). At 200 drawing units per metre, the dashed offset moves its endpoint as a point to (1.20, 0.40). A direction receives rotation but no origin offset. Homogeneous coordinates encode this difference by appending 1 to a point and 0 to a direction:
T_{BC}=egin{bmatrix}R&t\0&1end{bmatrix},quad T_{BC}egin{bmatrix}p_C\1end{bmatrix}=egin{bmatrix}Rp_C+t\1end{bmatrix},quad T_{BC}egin{bmatrix}v_C\0end{bmatrix}=egin{bmatrix}Rv_C\0end{bmatrix}.The planar matrix is 3×3, in SE(2). Translation is affine in ordinary coordinates; it becomes part of a linear operation in augmented homogeneous coordinates. The final coordinate is not an arbitrary scale applied to the physical scene.
5. Map Camera To Base
Return to the original mount and the 300-unit-per-metre spatial view. From C, camera x contributes 0.10 m down, while camera y contributes 0.40 m right. Add these rotated components to the camera origin:
T_{BC}=egin{bmatrix}0&1&0.80\-1&0&0.50\0&0&1end{bmatrix},qquad T_{BC}egin{bmatrix}0.10\0.40\1end{bmatrix}=egin{bmatrix}1.20\0.40\1end{bmatrix}.Thus m and m. The same 0.40 value appears twice in the picture for different quantities: local camera y displacement and final base y coordinate. No arm, obstacle or payload model is specified, so these coordinates alone establish neither reachability nor a safe grasp.
6. Check The Reverse Map
First subtract the offset in base coordinates: . Then unrotate with , obtaining (0.10, 0.40) m. The paired plots use the same 240-unit-per-metre vector scale, with separate origins for readability.
T_{CB}=T_{BC}^{-1}=egin{bmatrix}R^T&-R^Tt\0&1end{bmatrix} =egin{bmatrix}0&-1&0.50\1&0&-0.80\0&0&1end{bmatrix}.Multiplying by (1.20, 0.40, 1) recovers the original camera point. Negating t without rotating it is generally wrong. A round trip verifies algebraic consistency; a consistently wrong calibration can still pass it.
7. Compose Frame Maps
Add world frame W, aligned with B and with B located at (1, 0) m in W. The scene uses 200 drawing units per metre. The same point is now at (2.20, 0.40) m in W. Composition is : the rightmost map acts first on .
Here the combined rotation stays −90° and the combined origin offset is (1.80, 0.50) m. Matching intermediate frame labels make the order checkable. Matrix multiplication is associative but generally not commutative. Modern Robotics 3.3.1 develops this frame-composition and inverse convention. Moving mounts require transforms appropriate to the measurement timestamp.
8. Extend To Three Dimensions
The paired charts use the same oblique projection: 100 drawing units per metre along x and z, with y projected 50 units right and 40 up. Their origins are separated for layout; projected screen lengths are not Euclidean 3D distances.
Extend the example to m, rotation −90° about z, and m. Rotation gives (0.40, −0.10, 0.20), then translation gives m. The transform is now 4×4: a 3×3 rotation, a three-component offset and bottom row (0, 0, 0, 1). Rigid pose has six degrees of freedom; the nine rotation entries are constrained, not nine independent angles.
9. Declare Axis Conventions
This separate convention diagram is qualitative, not the earlier planar mount. ROS REP-103 specifies a right-handed body convention: x forward, y left and z up. Its optical suffix frame uses z forward, x right and y down. Physical forward points the same way in both triads despite receiving different axis names.
For an aligned forward-facing camera with a coincident origin, optical-to-body coordinates map as . Actual mounts also require their measured extrinsic rotation and offset. A naming convention alone does not calibrate a camera.
10. Where It Breaks
Return to the original planar fixture. Keep R and the measured camera point correct, but let the software use offset (0.95, 0.50) m instead of (0.80, 0.50). The wrong transform outputs (1.35, 0.40) m rather than (1.20, 0.40) m. The x-only error is exactly 0.15 m. The final picture zooms to 1,200 drawing units per metre, so that miss spans 180 drawing units.
The real point remains fixed; only the commanded target is wrong. This demonstrates one translation calibration error, not a predicted result of an unspecified angular error or a guaranteed collision. An inverse made from the same incorrect transform still round-trips correctly. Calibration needs external physical checks beyond consistent matrix arithmetic.
The Quick Version
- Every coordinate needs a declared frame.
- Parallel axes permit direct addition of the origin offset.
- Rigid rotation preserves physical lengths and angles.
- Homogeneous points receive translation; direction vectors do not.
- Rotate local coordinates before adding the destination-frame offset.
- Inversion subtracts the offset and then undoes rotation.
- Compose maps with the rightmost transform acting first.
- Spatial transforms use constrained rotation matrices and three-component offsets.
- Optical and body frames name physical directions differently.
- Consistent algebra cannot prove correct physical calibration.