Homogeneous Coordinates
In the previous lessons, rotation was a matrix multiplication and translation was an addition. Having two different operations is awkward — especially when you need to chain many transforms together. Homogeneous coordinates unify rotation and translation into a single matrix multiplication.
The Problem
To rotate and then translate a 2D point:
This requires two separate operations. We can’t represent translation as a 2×2 matrix multiply on a 2D vector. But what if we added an extra dimension?
2D Homogeneous Transformations
The key idea: represent a 2D point as a 3D vector by appending a 1. Now we can build a 3×3 matrix that handles both rotation and translation:
Applying it:
One multiplication does both rotation and translation!
SE(2): Special Euclidean Group
The set of all 2D rigid-body transformations (rotation + translation, no scaling or shearing) forms the group SE(2).
- Special: determinant = +1 (no reflections)
- Euclidean: distances are preserved
- This is the mathematically precise way to describe robot motion in a plane
Structure of the 3×3 Matrix
The top-left 2×2 block is the rotation matrix. The top-right column is the translation vector. The bottom row is always .
Transformation Composition in SE(2)
The biggest advantage of homogeneous coordinates: chaining transforms is just matrix multiplication.
Apply first, then — same right-to-left rule as before.
Worked Example
Transform 1: Rotate 90° and translate :
Transform 2: Rotate 0° and translate :
Composite :
Applying to the origin : the point ends up at . First rotates and translates to , then shifts it up by 2 to .
3D Homogeneous Transformations
The same idea extends to 3D using 4×4 matrices:
This is an element of SE(3) — the Special Euclidean group in 3D. SE(3) has 6 degrees of freedom: 3 for rotation (from SO(3)) and 3 for translation.
Efficient Inverse
The inverse of a homogeneous transform has a special structure:
No need for general matrix inversion — just transpose and compute . This is much faster and more numerically stable.
Robot Coordinate Frames Robotics Application
Every link of a robot arm has its own coordinate frame. The transformation describes how frame relates to frame :
- The rotation part encodes the relative orientation between the two frames
- The translation part encodes the offset between their origins
These 4×4 homogeneous transformation matrices encode both rotation and translation between consecutive joints in a single, elegant matrix.
Forward Kinematics: Chaining Transforms
For a robot arm with joints, the end-effector pose relative to the base is:
Each depends on the joint angle and the link geometry. Multiply them all together to get the end-effector’s position and orientation.
2-Link Planar Robot Arm Robotics Application
Consider a 2-link planar arm with joint angles , and link lengths , .
Frame 0 → Frame 1 (rotate by , extend by ):
Frame 1 → Frame 2 (rotate by , extend by ):
The end-effector position from :
This is forward kinematics — computing where the end-effector is from joint angles. Try it in the interactive demo below!
Denavit-Hartenberg (DH) Convention
The 2-link example above manually constructed each transform. For a 6-DOF industrial arm, we need a systematic method. The Denavit-Hartenberg convention provides exactly this — a standard way to describe any serial robot with just 4 numbers per joint.
The Four DH Parameters
Each joint i in a serial manipulator is fully described by:
| Parameter | Symbol | Meaning |
|---|---|---|
| Joint angle | Rotation about the z-axis (variable for revolute joints) | |
| Link offset | Translation along the z-axis (variable for prismatic joints) | |
| Link length | Translation along the x-axis | |
| Link twist | Rotation about the x-axis |
The DH Transformation Matrix
These four parameters combine into a single 4×4 homogeneous transform:
The full forward kinematics is then:
Example: 2-Link Planar Arm as a DH Table
The same arm from above can be described with a DH parameter table:
| Joint | ||||
|---|---|---|---|---|
| 1 | 0 | 0 | ||
| 2 | 0 | 0 |
Since all joints are revolute and planar, only varies and the twist . Plugging into the DH formula with and gives exactly the transforms we derived manually — the DH convention just provides a systematic way to arrive at them.
DH in Code
The math library provides dhTransform(a, alpha, d, theta) which implements the DH matrix above. For the 2-link arm: dhTransform(L1, 0, 0, theta1) produces the same we built by hand.
Note: There are two DH conventions — Standard (used here, from Denavit & Hartenberg) and Modified (from Craig’s textbook), which places coordinate frames differently. Always check which convention your library uses.
Common DH Pitfalls
- Parameter order varies between textbooks: some use (, , , ), others use (, , , ). Always check.
- Standard vs. Modified DH: These produce different transforms for the same robot. Mixing them is a frequent source of bugs.
- Frame assignment: Choosing where to place each coordinate frame has rules that can be subtle for complex robots. This is covered in detail in Module 5.
Inverse Transforms
The inverse “undoes” a transformation. If converts from frame A to frame B, then converts from B back to A.
Application: A robot’s camera sees an object in its local frame. To find the object’s position in the world frame, apply the camera’s transformation. To go the other way (world → camera), apply the inverse.
Interactive Visualization
Explore a 2-link planar robot arm. Adjust joint angles and link lengths to see how the homogeneous transformation matrices chain together. Each joint’s coordinate frame is shown, and the matrices update in real-time.
T₀₁ (Base → Joint 1)
| [ | 0.707 | -0.707 | 1.061 | ] |
| [ | 0.707 | 0.707 | 1.061 | ] |
| [ | 0.000 | 0.000 | 1.000 | ] |
T₁₂ (Joint 1 → End)
| [ | 0.500 | -0.866 | 0.600 | ] |
| [ | 0.866 | 0.500 | 1.039 | ] |
| [ | 0.000 | 0.000 | 1.000 | ] |
T₀₂ = T₀₁ · T₁₂
| [ | -0.259 | -0.966 | 0.750 | ] |
| [ | 0.966 | -0.259 | 2.220 | ] |
| [ | 0.000 | 0.000 | 1.000 | ] |
End-Effector Pose
Key insight: The end-effector pose T₀₂ is computed by multiplying T₀₁ · T₁₂. This "chaining" of homogeneous transforms is the foundation of forward kinematics — computing where the end-effector is from joint angles.
Practice Problems
-
Compute the 3×3 homogeneous transform for a rotation by 90° and translation .
-
Given = rotate 45° with translation and = rotate −45° with translation , where does the origin end up after applying ?
-
For a 2-link robot with , what joint angles reach the point ?
Answers
-
-
First compute : the origin maps to (the translation part of ). Then compute : rotates by −45° and translates by . The result is .
-
The end-effector must satisfy and . One solution: , gives . ✓ Another solution: , gives . ✓
Key Takeaways
- Homogeneous coordinates unify rotation and translation into a single matrix multiplication
- In 2D: 3×3 matrices in SE(2); in 3D: 4×4 matrices in SE(3)
- Chaining transforms = matrix multiplication:
- Efficient inverse: uses and (no general matrix inversion needed)
- This is the mathematical foundation of forward kinematics — the basis of all robot motion
Next Steps
You now have the mathematical tools for robot kinematics! In Module 4, we’ll explore eigenvalues and eigenvectors, coordinate frames in more depth, and alternative rotation representations like quaternions that avoid gimbal lock.