← back to the work log

Classical Robotics: Theory Notes

last updated

Classical Robotics

Before jumping into reinforcement learning, VLAs, and more modern robot learning approaches, it is helpful to understand earlier approaches and their limitations.

Classical robotics relies heavily on explicit models, while modern robot learning often uses implicit models. Explicit models mathematically describe the mechanics of the robot and its interaction with the environment.

For example, we might describe the robot's geometry by specifying how long each link is, where each joint is, and how those joints are connected.

Let's look at the simplest robotic example: planar manipulation.

two links · two revolute joints
Planar manipulationA fixed base joint and an elbow joint connect two rigid links. Drag the elbow or tip, or use the angle sliders below. Theta two is measured relative to the first link.xy0θ₁θ₂l₁l₂end effector
l₁ = 1 · l₂ = 0.8x = 0.68 · y = 1.36
Drag the elbow or tip to move the arm. θ₂ is relative to the first link.

Consider this simple planar robot arm with two rigid links of lengths l1l_1 and l2l_2, connected by two revolute joints described by θ1\theta_1 and θ2\theta_2.

The robot's configuration is:

q=[θ1θ2]q = \begin{bmatrix} \theta_1 \\ \theta_2 \end{bmatrix}

where θ1\theta_1 and θ2\theta_2 are the two joint angles. This is the robot's position in joint space.

But for manipulation, we usually care about where the end effector is in the world. Since this robot only moves in a 2D plane, we can describe the end effector in Cartesian task space as

p=[xy]p = \begin{bmatrix} x \\ y \end{bmatrix}

So the first problem is: given the joint angles, where is the end effector? This mapping from joint space to task space is called forward kinematics:

p=f(q)p=f(q)

Using geometry, we know for our two-link planar arm:

x=l1cos⁡θ1+l2cos⁡(θ1+θ2)y=l1sin⁡θ1+l2sin⁡(θ1+θ2)\begin{aligned} x &= l_1\cos\theta_1 + l_2\cos(\theta_1+\theta_2) \\ y &= l_1\sin\theta_1 + l_2\sin(\theta_1+\theta_2) \end{aligned}

The first link contributes l1cos⁡(θ1)l_1\cos(\theta_1) in the x-direction and l1sin⁡(θ1)l_1\sin(\theta_1) in the y-direction.

The second link is rotated by θ2\theta_2 relative to the first, so its total angle relative to the world is θ1+θ2\theta_1+\theta_2.

Together, these equations let us take any configuration in joint space and calculate exactly where the end effector is in task space.

Forward kinematics is useful for determining where the end effector currently is, but normally we already know where we want the end effector to go.

For example, suppose we want the end effector of our planar arm to reach some target position. We know the desired position in Cartesian task space, but now we need to determine what joint configuration will place the robot there: this is the inverse kinematics problem.

So for our planar arm, recall:

x=l1cos⁡θ1+l2cos⁡(θ1+θ2)y=l1sin⁡θ1+l2sin⁡(θ1+θ2)\begin{aligned} x &= l_1\cos\theta_1 + l_2\cos(\theta_1+\theta_2) \\ y &= l_1\sin\theta_1 + l_2\sin(\theta_1+\theta_2) \end{aligned}

To solve for θ2\theta_2, we can start by squaring both equations and adding them together:

x2+y2=(l1cos⁡(θ1)+l2cos⁡(θ1+θ2))2+(l1sin⁡(θ1)+l2sin⁡(θ1+θ2))2\begin{aligned} x^2 + y^2 ={}& \left(l_1\cos(\theta_1) + l_2\cos(\theta_1+\theta_2)\right)^2 \\ &+ \left(l_1\sin(\theta_1) + l_2\sin(\theta_1+\theta_2)\right)^2 \end{aligned}

Expanding both terms:

x2+y2=l12cos⁡2θ1+l12sin⁡2θ1+l22cos⁡2(θ1+θ2)+l22sin⁡2(θ1+θ2)+2l1l2cos⁡θ1cos⁡(θ1+θ2)+2l1l2sin⁡θ1sin⁡(θ1+θ2)\begin{aligned} x^2 + y^2 &= l_1^2\cos^2\theta_1 + l_1^2\sin^2\theta_1 \\ &\quad + l_2^2\cos^2(\theta_1+\theta_2) + l_2^2\sin^2(\theta_1+\theta_2) \\ &\quad + 2l_1l_2\cos\theta_1\cos(\theta_1+\theta_2) \\ &\quad + 2l_1l_2\sin\theta_1\sin(\theta_1+\theta_2) \end{aligned}

Now we can group some of these terms together using

cos⁡2θ+sin⁡2θ=1.\cos^2\theta + \sin^2\theta = 1.

So,

x2+y2=l12+l22+2l1l2[cos⁡θ1cos⁡(θ1+θ2)+sin⁡θ1sin⁡(θ1+θ2)]x^2 + y^2 = l_1^2 + l_2^2 + 2l_1l_2\big[\cos\theta_1\cos(\theta_1+\theta_2) + \sin\theta_1\sin(\theta_1+\theta_2)\big]

Using the trigonometric identity

cos⁡(A−B)=cos⁡(A)cos⁡(B)+sin⁡(A)sin⁡(B)\cos(A-B) = \cos(A)\cos(B) + \sin(A)\sin(B)

We can simplify to

x2+y2=l12+l22+2l1l2cos⁡(θ2)x^2 + y^2 = l_1^2 + l_2^2 + 2l_1l_2\cos(\theta_2)

Now we can rearrange to isolate cos⁡(θ2)\cos(\theta_2):

cos⁡(θ2)=x2+y2−l12−l222l1l2\cos(\theta_2) = \frac{x^2+y^2-l_1^2-l_2^2}{2l_1l_2}

Finally,

θ2=cos⁡−1(x2+y2−l12−l222l1l2)\theta_2 = \cos^{-1} \left( \frac{x^2+y^2-l_1^2-l_2^2}{2l_1l_2} \right)

But there is an important detail here: there are generally two valid solutions for θ2\theta_2, because cosine is symmetric. The two solutions correspond to the two different ways the planar arm can reach the same point: an elbow-up configuration and an elbow-down configuration.

one target · two solutions
Two ways to reach the same pointClick or drag a target. The solid and faded arms show the two inverse kinematics solutions. Use the joint angle sliders below as a keyboard alternative.xy0θ₁θ₂l₁l₂end effector

solid: θ₁ 35.0° · θ₂ 65.0°

ghost: θ₁ 91.9° · θ₂ -65.0°

l₁ = 1 · l₂ = 0.8x = 0.68 · y = 1.36
Click or drag a target. Both arms reach the same point; targets outside the workspace snap to its boundary.

We can follow a similar process to solve for θ1\theta_1 once we have chosen one of the two solutions for θ2\theta_2.

What we just derived is an analytical solution to inverse kinematics: we explicitly rearranged the equations and solved for the joint angles.

For a simple two-link planar arm this works well, but as robots become more complex, deriving a closed-form solution can become difficult or even impossible.

Instead, inverse kinematics is often framed as an optimization problem. We search for the joint configuration qq that minimizes the error between the current end-effector position and our desired position p∗p^*:

q∗=arg⁡min⁡q∥p(q)−p∗∥2q^* = \underset{q}{\arg\min} \left\| p(q)-p^* \right\|^2

In other words, try different joint configurations until we find one that places the end effector as close as possible to our target.

This becomes much more useful for robots like our SO-101, where instead of solving for just two joint angles, we have a 6-DOF robot with a much larger configuration space.

But inverse kinematics only tells us the joint configuration needed to reach the destination. If there are obstacles in the way, we also need motion planning to find a collision-free path, and differential kinematics to relate joint velocities to end-effector velocities as we move along that path.

Recall that for our two-link planar arm:

x=l1cos⁡θ1+l2cos⁡(θ1+θ2)y=l1sin⁡θ1+l2sin⁡(θ1+θ2)\begin{aligned} x &= l_1\cos\theta_1 + l_2\cos(\theta_1+\theta_2) \\ y &= l_1\sin\theta_1 + l_2\sin(\theta_1+\theta_2) \end{aligned}

Now instead of only asking where the robot should end up, we want to understand how moving each joint changes the position of the end effector.

In other words, how does changing θ1\theta_1 affect xx and yy? We can calculate this using partial derivatives:

∂x∂θ1=−l1sin⁡θ1−l2sin⁡(θ1+θ2)∂x∂θ2=−l2sin⁡(θ1+θ2)∂y∂θ1=l1cos⁡θ1+l2cos⁡(θ1+θ2)∂y∂θ2=l2cos⁡(θ1+θ2)\begin{aligned} \frac{\partial x}{\partial\theta_1} &= -l_1\sin\theta_1 - l_2\sin(\theta_1+\theta_2) \\[0.6em] \frac{\partial x}{\partial\theta_2} &= -l_2\sin(\theta_1+\theta_2) \\[0.6em] \frac{\partial y}{\partial\theta_1} &= l_1\cos\theta_1 + l_2\cos(\theta_1+\theta_2) \\[0.6em] \frac{\partial y}{\partial\theta_2} &= l_2\cos(\theta_1+\theta_2) \end{aligned}

These four partial derivatives tell us how sensitive the end-effector position is to each joint angle. We can collect them into a matrix called the Jacobian:

J(q)=[∂x∂θ1∂x∂θ2∂y∂θ1∂y∂θ2]J(q) = \begin{bmatrix} \frac{\partial x}{\partial \theta_1} & \frac{\partial x}{\partial \theta_2} \\[0.6em] \frac{\partial y}{\partial \theta_1} & \frac{\partial y}{\partial \theta_2} \end{bmatrix}

The Jacobian lets us relate joint velocities to end-effector velocities.

We can write the joint velocities as

q˙=[θ˙1θ˙2]\dot{q} = \begin{bmatrix} \dot{\theta}_1 \\ \dot{\theta}_2 \end{bmatrix}

and end-effector velocities as

p˙=[x˙y˙]\dot{p} = \begin{bmatrix} \dot{x} \\ \dot{y} \end{bmatrix}

Where finally

p˙=J(q)q˙\dot{p} = J(q)\dot{q}

Differential inverse kinematics works well when the desired trajectory is well specified, but its performance can degrade when there are modeling errors, tracking errors, or unmodeled dynamics in the environment.

To compensate for these errors, we typically introduce feedback control using methods such as PID, LQR, or MPC, which continuously measure the robot's actual state and adjust its control inputs to keep it on the desired trajectory.

The broader limitation of classical model-based robotics is that these systems are often designed and tuned for a specific robot, task, and set of operating conditions. The models themselves are also only approximations of the real world, so performance can degrade when reality differs from those assumptions. And unlike modern learning-based approaches, classical methods do not naturally take advantage of the growing amount of real-world robotics data that can be used to learn more flexible behaviour.