From Wheel Speeds to a Path on the Map

A wheeled robot has two knobs: its left and right wheel speeds. They set a forward speed and a turn rate, and the heading turns those into a path on the map. The robot can never slide sideways, yet it can still park 0.6 m to its left.

Pick a move and watch two wheel speeds become a path. Then we build, piece by piece, frames, rotations, rigid transforms, the no-slip rule and the wheel models behind it.

You need sine and cosine, what a vector is and a little Python. We build the matrices from zero.

Lesson 2 of 15 in our follow-along of Stanford AA 274A, Principles of Robot Autonomy I. Every idea is re-taught here in our own words and devices. Before: Lesson 1, the autonomy stack. Next: Lesson 3, motion planning.

Turn two wheel speeds into a path

Illustrative toy: wheel radius 5 cm, wheels 30 cm apart, the size of a small lab robot. Teal is the robot, its body axes and its trail. Warm bars are the wheel commands, in radians per second.

Chapter 0

"Forward" Is Not a Direction on the Map

Spin a robot and send the same command; watch it land somewhere new each time

Tell a small robot: drive forward 1 m. Where does it end up on the map? You cannot say yet. "Forward" is wherever the robot's nose points, and the nose turns with the robot.

The map has a fixed world frame: an origin on the floor, an x axis pointing east and a y axis pointing north. The robot carries its own body frame: the origin at its centre, x out of its nose, y out of its left side. When the robot turns, its body frame turns with it.

Send "forward 1 m" at any heading

The warm arrow is the command: 1 m along the nose. The grey arrow is east on the map. Set the heading, then press Forward.

40°

Illustrative toy on a 1 m grid. The robot always moves exactly 1 m along its nose.

Work the number. Facing 0°, forward 1 m moves the robot by (1.00, 0.00) on the map. Facing 90°, by (0.00, 1.00). Facing 40°, by (0.77, 0.64): that is cos 40° and sin 40°. The heading turns one body command into different world moves.

Three languages meet in every wheeled robot. This lesson builds the translators between them.

LayerSpeaksExample
Plannerworld frame"reach (4.2, 1.8) facing 90°"
Kinematicsbody frameforward speed v, turn rate ω
Motorswheel speedsleft 10 rad/s, right 14 rad/s

The failure, as symptom, measurement and fix

The symptom is a robot that drives off at the wrong angle when its start heading changes. To measure it, log the command and the world move at two headings. The fix is to rotate every body command by the heading, as Chapter 2 shows.

The road

  1. Frames: one point, two sets of coordinates.
  2. Rotation: build the matrix R(θ) from two arrows.
  3. Rigid transform: rotate, then shift, in one matrix.
  4. Chains: multiply transforms, and mind the order.
  5. Constraints: rules on velocity, in Pfaffian form.
  6. Holonomic or not: why parking takes a shuffle (the hero's Sidestep).
  7. Unicycle: two knobs, three rates, and Euler steps.
  8. Real wheels: differential drive and the simple car (the hero's wheel bars).
  9. Drive it: park a robot in the yellow box.
  10. Field guide: terms, numbers, 3D, code and the credit.
A robot faces 90° (north). It drives forward 1 m. How does its position on the map change?

Chapter 1

Two Frames, One Point

Drag a dock and a robot, and read one point in two frames

A charging dock sits on the floor. From the map origin it is at (5, 3). From the robot it is "3 m ahead and 2 m to the left". Both are right. They describe one spot from two places.

A reference frame is an origin plus a set of axis directions. We write the frame as a small letter before the point. Wp (W-p) is point p in the world frame. Bp (B-p) is the same point in the body frame.

Start with the easy case: the robot has not turned, so its axes are parallel to the world's. Call the robot's position on the map OB (O-B), the origin of the body frame.

Say it aloud

B-p equals W-p minus O-B.

Bp
B-p the point as the robot sees it, in metres.
Wp
W-p the point on the map, in metres.
−
minus subtract x from x and y from y.
OB
O-B where the robot stands on the map.
In plain words

Subtract the robot's position O-B from the point's map position W-p. The rest, B-p, is the point seen from the robot. Add O-B back to undo it.

With numbers

Robot at O-B = (2, 1), dock at W-p = (5, 3). B-p = (5 − 2, 3 − 1) = (3, 2). Adding (2, 1) back gives (5, 3) again.

Read one dock in two frames

Drag the pink dock or the teal robot. Grey is the world frame; teal is the body frame.

Illustrative toy. Positions snap to 0.1 m. The body frame does not rotate here; Chapter 3 adds the turn.

The failure, as symptom, measurement and fix

The symptom is a target that drifts the wrong way when the robot moves. Ask what moved: the thing or the observer. If the robot drives 1 m east, the dock's world x stays and its body x drops by 1. To measure it, move only the robot in a test and check the sign. The fix is to name the frame in every variable, as in p_body and p_world.

A landmark is at (7, 4) on the map. A robot with axes parallel to the world stands at (3, 4). Where is the landmark in the body frame?

Chapter 2

Rotation in the Plane: Build the Rotation Matrix

Turn a dial and watch two axis arrows fill the matrix

The subtraction works only while the frames are parallel. Once the robot turns, we must also turn vectors. A rotation matrix is a 2 by 2 table of numbers that turns any vector by an angle θ (theta), counter-clockwise.

Do not memorise it. Ask one question: where do the two axis arrows go? Every vector is a mix of the x arrow (1, 0) and the y arrow (0, 1). Turn both, and you have turned everything.

  1. The x arrow (1, 0), turned by θ, lands at (cos θ, sin θ).
  2. The y arrow (0, 1) starts at 90°, so it lands at 90° + θ: (−sin θ, cos θ).
  3. A matrix's columns are where the axis arrows land. Stack the two results as columns.
Say it aloud

R of theta is the two by two matrix: cos theta, minus sine theta on top; sine theta, cos theta below.

R(θ)
R of theta the rotation matrix for the angle theta, in degrees or radians.
cos θ, sin θ
first column, cos theta over sine theta where the x arrow lands.
−sin θ, cos θ
second column, minus sine theta over cos theta where the y arrow lands.
In plain words

To turn a vector (x, y) by theta, take x times the first column. Add y times the second column. The sum is the turned vector.

With numbers

At theta = 90°, cos is 0 and sin is 1. Turn (2, 1): 2 × (0, 1) + 1 × (−1, 0) = (−1, 2). Mostly right became mostly up.

Turn the axis arrows

The two teal arrows are the columns of R. The pink arrow is the vector (2, 1), turned. Watch the arrows stay square and length 1.

30°

Exact maths on a toy vector. Angles count counter-clockwise from the x axis.

Three facts make R a rotation. Together they define the set SO(2): all 2 by 2 rotations.

FactWhat it meansCheck at 30°
R⊤R = Icolumns are square and length 1: no stretch0.866 × (−0.5) + 0.5 × 0.866 = 0
det R = 1a turn, not a mirror0.866² + 0.5² = 1
R−1 = R⊤undo a turn by flipping the matrixthe flip is R(−30°)

The failure, as symptom, measurement and fix

The symptom is a robot that turns the wrong way. The minus sign sits in the wrong corner, so R turns clockwise. To measure it, turn (1, 0) by +90° and expect (0, 1). The fix is that one test in your code, as the Code Lab checks.

Why is the inverse of a rotation matrix equal to its transpose?

Chapter 3

Rotate, Then Shift: One Matrix for a Pose

Move a robot and watch one matrix carry a point from its body to the map

A robot that has turned and moved needs both steps. To take a point from the body frame to the map, first rotate it by the heading θ, then shift it by the robot's position. Call that position t = (tx, ty), the translation.

A matrix and a vector, applied in the right order, invite bugs. So we use a trick: write every point with a third number, always 1. These are homogeneous coordinates: (x, y) becomes (x, y, 1), and we mark it with a tilde, p̃. Now one 3 by 3 matrix does both steps. This matrix is a rigid-body transform. The set of all of them is SE(2).

Say it aloud

W-p-tilde equals T times B-p-tilde. T holds R of theta in its top-left corner, t-x and t-y in its last column, and zero, zero, one along the bottom.

Wp̃
W-p-tilde the point on the map, written (x, y, 1).
T
T the transform: the robot's whole pose in one matrix.
Bp̃
B-p-tilde the same point in the body frame, written (x, y, 1).
cos θ … cos θ
R of theta the rotation from Chapter 2, for the heading theta.
tx, ty
t-x, t-y where the robot stands on the map, in metres.
0 0 1
zero, zero, one the bottom row; it keeps the last number equal to 1.
In plain words

Multiply each row of T by the body point (x, y, 1). The 1 picks up t-x and t-y, so the shift rides along with the turn. The answer is the map point, still ending in 1.

With numbers

The robot stands at t = (2, 1), facing theta = 90°. A point is 3 m ahead: B-p-tilde = (3, 0, 1). Row 1: 0 × 3 − 1 × 0 + 2 × 1 = 2. Row 2: 1 × 3 + 0 × 0 + 1 × 1 = 4. The point is at (2, 4): 3 m north of the robot.

Carry a point from the body to the map

The pink point is fixed in the robot's body frame. Turn the robot, slide the point along the nose, or drag the robot. The read-out does T's two rows.

90°
3.0 m

Exact maths on a toy floor. The robot snaps to 0.5 m when you drag it.

The failure, as symptom, measurement and fix

The symptom is a point that lands in the wrong place. The usual cause is shift first, then rotate. To measure it, run the 90° test above and expect (2, 4). Shift-then-rotate gives R(90°) times (5, 1) = (−1, 5). The fix is to let T do both steps, never the two by hand.

Why do we append a 1 to each point before we apply an SE(2) transform?

Chapter 4

Chain Transforms: Multiply, and Mind the Order

Bolt a camera on a robot and find where it looks on the map

Someone bolts a camera to the robot. You know the camera's pose on the robot and the robot's pose on the map. Where is the camera on the map? Write each pose as a transform, then multiply.

Name a transform by two frames. TWB (T-W-B) is the body frame B described in the world frame W. TBC (T-B-C) is the camera frame C described in the body frame B.

Say it aloud

T-W-C equals T-W-B times T-B-C.

TWC
T-W-C the camera's pose on the map: the answer.
TWB
T-W-B the robot's pose on the map.
·
times a matrix product; the order matters.
TBC
T-B-C the camera's pose on the robot: where it sits.
In plain words

Write the chain so the inner letters touch: W-B, then B-C. The two B's cancel. The outer letters, W and C, name the answer.

With numbers

Robot at (2, 1), facing 90°. Camera 1 m ahead, turned 90°: T-B-C is (1, 0, 90°). The product puts the camera at (2, 2), facing 180°. Swap the order and you get (0, 2), 2 m off.

Find the camera on the map

Turn the robot and the camera mount. Then press Swap the order to see where the wrong product puts the camera.

90°
90°

Illustrative toy: the robot stays at (2, 1) and the camera sits 1 m ahead of its centre.

To go the other way, invert. A rigid transform has a cheap inverse: turn back with R⊤ (R-transpose) and shift by −R⊤t.

TBW = TWB−1 = R⊤−R⊤t0 01

For the robot above, the dock at (5, 3) on the map sits at (2, −3) in the body. That is 2 m ahead and 3 m to the right.

The failure, as symptom, measurement and fix

The symptom is a sensor reading that lands metres off on the map. The usual cause is the order TBC · TWB. To measure it, check that the inner letters touch. The fix is names like T_world_body and T_body_cam, so a wrong chain reads wrong.

You know TWB (robot on the map) and TBC (camera on the robot). Which product gives the camera on the map?

Chapter 5

Constraints: Rules on How a Robot May Move

Aim a velocity at a pendulum and see which directions the rule lets through

Lesson 1 named the pose ξ (xi) = (x, y, θ): the robot's configuration. Its rate of change, ξ̇ (xi-dot) = (ẋ, ẏ, θ̇), says how fast each number changes. A kinematic constraint is a rule that these must obey at every instant.

Most robot rules are linear in the velocities: each rate appears once, never squared. The course writes them in Pfaffian form. Call the table of rule numbers A(ξ); its numbers depend only on where the system is.

Say it aloud

A-transpose of xi, times xi-dot, equals zero.

A⊤(ξ)
A-transpose of xi one row per rule; each row is a forbidden direction, set by the pose xi.
ξ̇
xi-dot the velocity: how fast each coordinate changes.
0
zero each row, multiplied into the velocity, must give zero.
In plain words

Multiply each row of A-transpose into the velocity xi-dot, entry by entry, and add. If the sum is zero, the velocity is square to that forbidden direction. The rule allows it.

With numbers

A bead on a rod of length 5 m sits at (3, 4). Its rule row is (3, 4). Velocity (−4, 3): 3 × (−4) + 4 × 3 = 0, allowed. Velocity (3, 4): 9 + 16 = 25, forbidden.

Where does the row (3, 4) come from? The rod fixes the distance, so x² + y² − L² = 0 at all times, with L the rod length. Take the rate of change: 2xẋ + 2yẏ = 0. Divide by 2. The rule row is (x, y), which points along the rod.

Aim a velocity at the bead

Move the bead around its circle, then aim the velocity. The rule lets a velocity through only when it is square to the rod.

53°
143°

Exact maths on a toy: rod 5 m, speed 5 m/s. "Allowed" means the rule value is within 0.5 of zero, so the slider can land on it.

The failure, as symptom, measurement and fix

The symptom is a simulated pendulum whose rod slowly stretches. Each straight step along the tangent leaves the circle a little. To measure it, track x² + y² − L² over time. The fix is to put the bead back on the circle after each step.

In A⊤(ξ) ξ̇ = 0, what does each row of A⊤ stand for?

Chapter 6

Holonomic or Not: Why Parking Takes a Shuffle

Push a robot sideways, then reach the same spot by a legal route

The pendulum and the rolling wheel both give a Pfaffian rule. They differ in one deep way. The pendulum's rule traps the bead on a circle. The wheel's rule forbids sliding, yet the robot can still reach every pose.

KindWhat it meansExamplePoses you can reach
Holonomicthe rule integrates to a position rule h(ξ) = 0pendulum: x² + y² = L²a circle: one dimension lost
Nonholonomicthe rule cannot be integrated to a position rulerolling wheel: no slidingevery (x, y, θ)

Now derive the wheel's rule. The robot rolls along its heading, (cos θ, sin θ). The axle points sideways, along (−sin θ, cos θ). No slip means zero velocity along the axle.

Say it aloud

x-dot sine theta minus y-dot cos theta equals zero.

ẋ
x-dot how fast x changes on the map, in metres per second.
ẏ
y-dot how fast y changes on the map, in metres per second.
sin θ
sine theta with minus cos theta, the rule row: the axle direction, sign flipped.
cos θ
cos theta the second entry of that row.
0
zero no speed along the axle. Turning, theta-dot, is free.
In plain words

Take the robot's velocity, x-dot and y-dot. Measure how much of it points along the axle. That sideways part must be zero.

With numbers

Facing 90° (north), sin 90° = 1 and cos 90° = 0, so the rule reads x-dot = 0. The robot may drive north and may turn, but may not slide east.

Why can we not integrate this rule? The forbidden direction turns with θ. Pivot, drive, pivot back: each leg is legal, and the sum is a sideways move. No fixed surface traps the robot.

Try to slide, then sidestep

Push the robot forward or sideways. With grip on, the wheels refuse the sideways push. Then press Sidestep to reach the spot by a legal route.

0°

Illustrative toy. A push is 0.3 m/s for 1 s. Grip off stands for omni wheels, which can slide.

The failure, as symptom, measurement and fix

The symptom is a planned path with a sideways step the robot cannot drive. To measure it, compute x-dot sin θ minus y-dot cos θ along the path; a value far from zero is a slide. The fix is to plan with the motion model, as Lessons 3 to 5 do.

Why is the rolling wheel's no-slip rule called nonholonomic?

Chapter 7

The Unicycle Model: Two Knobs, Three Rates

Set a speed and a turn rate, and watch Euler steps chase the true arc

The no-slip rule says what the robot cannot do. The unicycle model says what it can do. It has two inputs: the forward speed v, in metres per second, and the turn rate ω (omega), in radians per second.

Say it aloud

x-dot equals v cos theta, y-dot equals v sine theta, and theta-dot equals omega.

ẋ
x-dot how fast x changes on the map, m/s.
ẏ
y-dot how fast y changes on the map, m/s.
θ̇
theta-dot how fast the heading changes, rad/s.
v
v the forward speed along the nose: input one.
ω
omega the turn rate: input two.
cos θ
cos theta the share of v that goes along x.
sin θ
sine theta the share of v that goes along y.
In plain words

Point the speed v along the heading theta: cos theta of it goes to x, sine theta of it to y. The heading changes at omega.

With numbers

v = 2 m/s, omega = 1 rad/s, facing theta = 0: x-dot = 2, y-dot = 0, theta-dot = 1. In the no-slip rule: 2 × 0 − 0 × 1 = 0. It holds for any v and omega.

A computer moves the pose in small time steps Δt (delta-t). Forward Euler says: new value = old value + rate × Δt. Two steps of Δt = 0.5 s, from (0, 0, 0) with v = 2 and ω = 1:

Stepxyθ
start000
1: rates (2, 0, 1)0 + 2 × 0.5 = 1.000.000.5 rad
2: rates (1.755, 0.959, 1)1 + 1.755 × 0.5 = 1.880.959 × 0.5 = 0.481.0 rad

Chase the true arc with Euler steps

Pink is the true path. Purple dots are Euler steps. Make Δt large and watch the steps cut outside the arc.

2.0 m/s
1.00 rad/s
1.0 s

Exact maths: the true path is the circle of radius v/ω, computed in closed form. Euler uses the rates at the start of each step.

Constant v and ω drive a circle of radius v/ω. After 1 s at v = 2 and ω = 1, the true pose is (1.68, 0.92). The two Euler steps reached (1.88, 0.48): 0.48 m off.

The failure, as symptom, measurement and fix

The symptom is a simulated robot that spirals outward on a circle. To measure it, compare one lap with the exact circle. The fix is a smaller Δt: the error halves when Δt halves, and Δt = 0.05 s gives 5 cm here.

A unicycle holds v = 2 m/s and ω = 0.5 rad/s. What path does it drive?

Chapter 8

Real Wheels: Differential Drive and the Simple Car

Set two wheel speeds, or a steering angle, and find the turning centre

No robot has an ω knob. A differential-drive robot has two driven wheels of radius r, a distance L apart. You set the wheel spin rates ωL and ωR (omega-L, omega-R), in radians per second. A wheel spinning at ωR rolls the ground at r × ωR.

Say it aloud

v equals r times omega-R plus omega-L, over 2. Omega equals r times omega-R minus omega-L, over L.

v
v the robot's forward speed, m/s.
ω
omega the robot's turn rate, rad/s; positive turns left.
r
r the wheel radius, m.
ωR
omega-R the right wheel's spin rate, rad/s.
ωL
omega-L the left wheel's spin rate, rad/s.
L
L the track: the distance between the two wheels, m.
In plain words

Average the two wheel ground speeds to get v. Divide their difference by the track L to get omega.

With numbers

r = 0.05 m, L = 0.30 m, omega-L = 10, omega-R = 14 rad/s. v = 0.05 × 24 / 2 = 0.60 m/s. Omega = 0.05 × 4 / 0.30 = 0.67 rad/s: a left circle of radius 0.90 m.

The controller needs the reverse. Add and subtract the two equations: ωR = (v + ω × L/2) / r and ωL = (v − ω × L/2) / r. With v = 0.60 and ω = 0.67, ωR = (0.60 + 0.10) / 0.05 = 14 rad/s. The motors get these numbers.

A car cannot pivot. The simple car, or bicycle model, drives at v and steers its front wheels by an angle φ (phi). Here L is the wheelbase: front axle to rear axle.

Say it aloud

Theta-dot equals v over L, times tan phi.

θ̇
theta-dot how fast the car's heading turns, rad/s.
v
v the speed of the rear axle, m/s.
L
L the wheelbase, m.
tan φ
tan phi the tangent of the steering angle; it grows as you steer harder.
In plain words

Divide the speed v by the wheelbase L. Multiply by tan phi. That is the turn rate, so at v = 0 the heading cannot change.

With numbers

L = 2.5 m, v = 5 m/s, phi = 10°: theta-dot = 2 × 0.176 = 0.35 rad/s. At the limit phi = 30°, the tightest circle is 2.5 / 0.577 = 4.33 m.

Find the turning centre

Choose a vehicle and set its inputs. The warm arc is the next 3 s of path; the cross is the centre it turns about.

10 rad/s
14 rad/s

Illustrative sizes: the robot has r = 5 cm and L = 30 cm; the car has a 2.5 m wheelbase and a 30° steering limit.

The failure, as symptom, measurement and fix

The symptom is a turn rate that is off by a constant factor. The usual cause is the wrong L: side to side for differential drive, front to back for the car. To measure it, command a pivot and time one full turn. The fix is to sketch the robot and label L.

In the simple car, θ̇ = (v / L) tan φ. Why can a parked car not turn on the spot?

Chapter 9

Drive It: Park in the Yellow Box

Command a robot three ways and bring it to a goal pose

Everything joins here. Choose how you command the robot: as a unicycle (v, ω), as a differential drive (ωL, ωR), or as a car (v, φ). One Euler step moves the pose and draws the trail. The goal is a pose, not a point: you must arrive facing north.

Park in the yellow box, facing north

Pick a mode, set the two sliders, press Drive. Change the sliders while it drives. Reset puts the robot back at the start.

1.50 m/s
0.00 rad/s

Illustrative toy. The diff drive has r = 10 cm and L = 50 cm; the car has a 0.8 m wheelbase. Parked means within 0.25 m and 20°. One route: drive straight about 1 m, then hold v = 1.5 and ω = 0.75 for about 2.1 s.

Work the route in the fine print. A circle of radius R = v/ω = 1.5 / 0.75 = 2.0 m. A quarter turn is π/2 rad, so it takes 1.571 / 0.75 = 2.1 s. Start at (0, 0) facing east and drive 1 m to (1, 0). The quarter circle then ends at (1 + 2, 0 + 2) = (3, 2), facing north.

This closes the loop from body to map. A slider sets a body command. The unicycle model turns it, through the heading, into a map velocity. Euler steps add that up into a path. Lesson 6 adds the feedback that chooses the command for you.

A robot holds v = 1.5 m/s and ω = 0.75 rad/s. What is the radius of its circle?

Chapter 10

Field Guide

Keep the terms, the numbers, the step to 3D and the code in one place

A frame is an origin and axes. A rotation matrix turns vectors; a rigid transform turns and shifts points, and transforms chain by multiplication. A wheel forbids sideways motion, a nonholonomic rule. The unicycle, the differential drive and the car turn wheel commands into map motion.

TermFormulaNumber to remember
Frame changeBp = Wp − OB (parallel)(5, 3) − (2, 1) = (3, 2)
Rotation, SO(2)R(θ) = [cos −sin; sin cos]R(90°)(2, 1) = (−1, 2)
Rigid transform, SE(2)Wp̃ = T Bp̃(2, 1, 90°) takes (3, 0) to (2, 4)
ChainTWC = TWB TBCcamera at (2, 2); swapped: (0, 2)
Pfaffian ruleA⊤(ξ) ξ̇ = 0bead at (3, 4): (−4, 3) passes, (3, 4) gives 25
No slipẋ sin θ − ẏ cos θ = 0facing north: x-dot = 0
Unicycleẋ = v cos θ, ẏ = v sin θ, θ̇ = ωcircle radius v/ω
Differential drivev = r(ωR + ωL)/2, ω = r(ωR − ωL)/L10 and 14 rad/s: 0.60 m/s, 0.67 rad/s
Simple carθ̇ = (v/L) tan φL = 2.5 m, 30°: smallest radius 4.33 m

Into 3D

A drone or an arm leaves the floor. The ideas carry over; the matrices grow.

ItemPlane, SE(2)Space, SE(3)
Rotation2 by 2, one angle θ3 by 3, three angles (roll, pitch, yaw) or a quaternion
Transform3 by 34 by 4, bottom row (0, 0, 0, 1)
Pose numbers36: 3 position, 3 orientation
Rotations commute?yesno: roll then pitch differs from pitch then roll
Chain ruleTWC = TWB TBCthe same

Checklist for any wheeled robot

The core, in code

python
import numpy as np

def SE2(x, y, th):                       # a pose as one 3x3 matrix
    c, s = np.cos(th), np.sin(th)
    return np.array([[c, -s, x], [s, c, y], [0, 0, 1]])

def apply(T, p):                          # body point -> map point
    return (T @ np.array([p[0], p[1], 1.0]))[:2]

T_world_body = SE2(2, 1, np.pi/2)
T_body_cam   = SE2(1, 0, np.pi/2)
T_world_cam  = T_world_body @ T_body_cam        # inner "body" letters touch
print(apply(T_world_body, [3, 0]))           # [2. 4.]
print(T_world_cam[:2, 2])                    # [2. 2.]  the camera on the map

def diff_drive(wL, wR, r=0.05, L=0.30):    # wheel speeds -> (v, omega)
    return r*(wR + wL)/2, r*(wR - wL)/L

def unicycle_step(x, y, th, v, w, dt):     # one forward-Euler step
    return x + v*np.cos(th)*dt, y + v*np.sin(th)*dt, th + w*dt

v, w = diff_drive(10, 14)                     # 0.60 m/s, 0.667 rad/s
pose = (0.0, 0.0, 0.0)
for _ in range(100):                          # 1 s in steps of 10 ms
    pose = unicycle_step(*pose, v, w, 0.01)

Keep going

Based on Stanford AA 274A, Principles of Robot Autonomy I. This page re-teaches the course's second lesson in our own words, devices and toy numbers.

The takeaway. Name every frame, let one matrix turn and shift, and multiply with the inner letters touching. Then remember the wheel: it rolls forward, never sideways, and two wheel speeds are enough to reach any pose.

Now press Present or Teach. Explain from memory: R(θ) from two arrows, the matrix T, the chain rule, the no-slip rule and the wheel equations. Then go back to the hero, press Sidestep, and say why the robot never slides.

Principles of Robot Autonomy I · Stanford AA 274A · Lesson 2: Rigid-Body Transforms and Wheeled Kinematics
Before: The Autonomy Stack · Next: Motion Planning · Back to Gleams