Skip to main content

Section 2.2 Differential Drive Forward Kinematics

A Differential Drive robot consists of two independently driven wheels on a common axis and one or two passive caster wheels for support. The left wheel drives at surface speed \(v_L\) and the right wheel at surface speed \(v_R\text{,}\) with the robotโ€™s center sitting on the axis between them, separated from each wheel by half of the track width \(L\text{.}\)
The core idea behind forward kinematics is simple even before you look at the equations: you already know how fast each wheel is turning (motor encoders report this directly), but what you actually want to know is how the whole robot moves through the world. Forward kinematics is the bridge between those two thingsโ€”it answers "given these wheel speeds, what does the robot as a whole do?" If both wheels spin at exactly the same speed, common sense says the robot should drive straight; if the wheels spin at different speeds, the faster wheel sweeps out a larger arc than the slower one, and the robot must curve toward the slower side. The equations below simply make that intuition precise.

Subsection 2.2.1 Forward Kinematics Equations

Forward Kinematics computes the robotโ€™s overall linear velocity \(v\) and angular velocity \(\omega\) from the individual wheel surface speeds (\(v_L\) and \(v_R\)) and the track width \(L\) (distance between left and right wheel centers):
\begin{equation*} v = \frac{v_R + v_L}{2} \end{equation*}
\begin{equation*} \omega = \frac{v_R - v_L}{L} \end{equation*}
Each formula has a plain-language reading. Linear velocity \(v\) is just the average of the two wheel speedsโ€”think of it as how fast the robotโ€™s center point is moving forward, splitting the difference between a slightly-faster and slightly-slower wheel. Angular velocity \(\omega\) is the difference between the wheel speeds, scaled by how far apart the wheels are (\(L\)): the bigger the mismatch between \(v_R\) and \(v_L\text{,}\) the sharper the robot turns, and a wider wheelbase "dilutes" that same speed difference into a gentler turn.

Subsection 2.2.2 State Integration Over Time Step \(\Delta t\)

Given a small time step \(\Delta t\text{,}\) the change in robot pose in its local frame is:
\begin{equation*} \Delta \theta = \omega \cdot \Delta t = \frac{(v_R - v_L) \cdot \Delta t}{L} \end{equation*}
\begin{equation*} \Delta x = v \cdot \cos\left(\theta + \frac{\Delta \theta}{2}\right) \cdot \Delta t \end{equation*}
\begin{equation*} \Delta y = v \cdot \sin\left(\theta + \frac{\Delta \theta}{2}\right) \cdot \Delta t \end{equation*}
Using the midpoint heading \(\theta + \frac{\Delta \theta}{2}\) rather than the starting heading \(\theta\) improves accuracy by accounting for the robotโ€™s rotation partway through the time step.

Subsection 2.2.3 Real-World & VEX AIM Examples

Real-World Example (Robot Vacuums & Warehouse AMRs): A robot vacuum has no GPS to rely on indoors. Instead, it uses forward kinematics on its own wheel encoder readingsโ€”a technique called dead reckoningโ€”to continuously estimate how far it has traveled and how much it has turned since it started, building up an internal map of the room purely from integrating its own wheel speeds over time. Warehouse Autonomous Mobile Robots (AMRs) rely on the exact same principle as a baseline position estimate, often fusing it with LiDAR or camera data to correct for the small errors that accumulate from wheel slip.
VEX AIM Robotics Example: During an autonomous VEX AIM routine, the robot has no external system telling it where it is on the fieldโ€”it must figure that out itself. Onboard code reads the left and right encoder velocities every control loop (often every 10-20 milliseconds), plugs them directly into these forward kinematics equations, and integrates the resulting \(\Delta x\text{,}\) \(\Delta y\text{,}\) and \(\Delta \theta\) into a running pose estimate. This is exactly how a VEX AIM robot "knows" it has driven forward 24 inches and turned 90 degrees, even though it never directly measures its positionโ€”it only measures wheel speed and does the math.

Subsection 2.2.4 Section 2.2 Interactive Exercises

Subsubsection 2.2.4.1 Exercise 2.2.1: Forward Kinematics Implementation Challenge

Implement the differential drive forward kinematics equations to compute the robotโ€™s new position \((\Delta x, \Delta y, \Delta \theta)\) after a short time step.
Task: Complete the forward_kinematics function below using \(v_L\text{,}\) \(v_R\text{,}\) track width \(L\text{,}\) and time step dt.
You have attempted of activities on this page.