Thrun et al., Chapter 5

Robot Motion

Probabilistic motion models: how uncertainty grows as a robot moves through the world.

Prerequisites: Chapters 2-4 (Bayes filter and filter implementations), trigonometry.
10
Chapters
1
Simulation
10
Quizzes

Chapter 0: Why Motion Models?

Every Bayes filter has two ingredients: a motion model p(xt | ut, xt-1) and a measurement model p(zt | xt). This chapter develops the motion model. The next chapter covers measurements.

Why does the robot need a probabilistic motion model? Because commands are never executed perfectly. Tell a robot to drive 1 meter forward and turn 90 degrees left. What actually happens? It drives 0.97 meters (or 1.04 meters), turns 87 degrees (or 93 degrees), and drifts slightly sideways. Wheels slip. Motors have variability. The floor is uneven.

The core insight: A deterministic motion model says "after this command, you will be HERE." A probabilistic motion model says "after this command, you will probably be near here, with this cloud of uncertainty." The Bayes filter prediction step uses this probability cloud to spread the belief forward in time.

This chapter focuses on mobile robots moving on a 2D plane. We develop two complementary models:

Velocity motion model: The robot is commanded with a translational velocity v and rotational velocity ω. Used for planning and prediction.

Odometry motion model: The robot measures how far its wheels actually turned. Used for post-hoc estimation (the data is only available after the motion).

Check: Why do we need a probabilistic motion model rather than a deterministic one?

Chapter 1: Robot Pose

For a mobile robot on a plane, the pose (or kinematic state) has three components:

xt = (x, y, θ)T

where (x, y) is the position in a global coordinate frame, and θ is the heading (orientation). A robot with θ = 0 points along the x-axis; θ = π/2 points along the y-axis.

TermDefinition
PosePosition + orientation: (x, y, θ)
LocationPosition only: (x, y)
Heading / bearingOrientation θ only
ConfigurationThe full kinematic state (for a planar robot, same as pose)
Why three dimensions? A rigid object on a plane has exactly 3 degrees of freedom: translate in x, translate in y, rotate. This is the minimum description. In 3D space, a rigid body has 6 DOF (3 position + 3 orientation). This book focuses on the planar case.
Check: How many numbers describe the pose of a planar mobile robot?

Chapter 2: Probabilistic Kinematics

Classical kinematics gives a deterministic function: given pose xt-1 and control ut, compute the next pose xt. Probabilistic kinematics extends this to a conditional density:

p(xt | ut, xt-1)

This density describes the probability of ending up at pose xt when starting at xt-1 and executing command ut. It captures the "cloud" of possible outcomes.

Imagine commanding a robot to drive forward and turn. The true motion is corrupted by noise in translation, rotation, and drift. The resulting probability cloud has a characteristic banana shape: spread along the arc of motion, wider at the end (where rotational error compounds translational error).

Key observation: In practice, the exact shape of the noise distribution often matters less than the fact that some noise is modeled. Many successful systems deliberately overestimate the noise, making the filter more robust to un-modeled effects and violations of the Markov assumption. A slightly "fatter" probability cloud is safer than a too-narrow one.

There are two ways to use a motion model:

Density evaluation: Given xt-1, ut, and xt, compute p(xt | ut, xt-1). Needed by histogram filters and EKF.

Sampling: Given xt-1 and ut, generate a random xt drawn from p(xt | ut, xt-1). Needed by particle filters.

Check: What two ways can a probabilistic motion model be used?

Chapter 3: Velocity Motion Model

The velocity model assumes the robot is controlled by two velocities:

ut = (vt, ωt)T

where vt is translational velocity (forward/backward) and ωt is rotational velocity (turning). This is the natural interface for differential-drive, synchro-drive, and Ackerman-drive robots.

Ideal (noise-free) motion: A robot with constant v and ω moves along a circular arc of radius r = v/ω. After time Δt:

x' = x - (v/ω) sin θ + (v/ω) sin(θ + ωΔt)
y' = y + (v/ω) cos θ - (v/ω) cos(θ + ωΔt)
θ' = θ + ωΔt

Noisy motion: The actual velocities differ from commanded ones. The model adds Gaussian noise to v and ω, controlled by six robot-specific error parameters α1 through α6:

ParameterControls
α1, α2Translational error from translation and rotation
α3, α4Rotational error from translation and rotation
α5, α6Final heading error
Physical intuition: Moving faster introduces more translational error (α1). Turning faster introduces more rotational error (α4). Even straight-line motion has some rotational drift (α2). These parameters are calibrated empirically for each robot.
Check: In the velocity motion model, what shape does the noise-free trajectory take?

Chapter 4: Velocity Sampling

For particle filters, we need to sample from the velocity motion model — generate random poses from p(xt | ut, xt-1). The algorithm is simple:

pseudocode
# Sample from velocity motion model
Input: xt-1 = (x, y, θ), ut = (v, ω)

# Add noise to commanded velocities
v̂ = v + sample(α1|v| + α2|ω|)
ω̂ = ω + sample(α3|v| + α4|ω|)
γ̂ = sample(α5|v| + α6|ω|)

# Apply noisy velocities
x' = x - (v̂/ω̂) sin θ + (v̂/ω̂) sin(θ + ω̂Δt)
y' = y + (v̂/ω̂) cos θ - (v̂/ω̂) cos(θ + ω̂Δt)
θ' = θ + ω̂Δt + γ̂Δt

return (x', y', θ')

The function sample(b) draws from a zero-mean distribution with variance b — typically Gaussian or triangular.

Key insight: We perturb the velocities, not the final pose. This is physically motivated: noise enters through the actuators (motors), which control velocities. The resulting pose uncertainty is a complex function of these velocity errors, producing the characteristic banana-shaped distributions.

Different noise settings produce very different distributions. High translational noise (α1, α2) spreads particles along the arc. High rotational noise (α3, α4) spreads them perpendicular to the arc. Balanced noise produces the banana shape.

Check: In the sampling algorithm, where is noise added?

Chapter 5: Motion Demo

Watch how the velocity motion model spreads particles. The robot starts at the left and executes a "drive forward and turn" command. Particles show the distribution of possible outcomes. Adjust the noise to see banana shapes, wide arcs, and tight clusters.

Velocity Motion Model Samples

Commanded: drive forward and turn. Teal dot = ideal endpoint. Orange dots = sampled endpoints (200 particles). Adjust noise parameters.

Trans. noise0.05
Rot. noise0.05
What to notice: With balanced noise, the cloud is banana-shaped — spread along the arc of motion. Increase translational noise and the cloud stretches along the arc. Increase rotational noise and it fans out. This is the "probability cloud" that the prediction step of the Bayes filter creates.
Check: What characteristic shape does the probability cloud take for balanced noise in the velocity model?

Chapter 6: Odometry Motion Model

The odometry model uses wheel encoder data instead of velocity commands. Most commercial robots provide odometry: "the left wheel turned X ticks, the right wheel turned Y ticks." From this, we can compute a relative motion estimate.

The odometry model decomposes motion into three phases:

ut = (δrot1, δtrans, δrot2)

δrot1: Initial rotation to face the new position.

δtrans: Translation to the new position.

δrot2: Final rotation to the new heading.

Think of it as: "Turn to face where you're going, drive straight there, then turn to your final heading." Any planar motion between two poses can be decomposed this way. The three values are computed from odometry readings.

Noise is added to each of the three components independently. The error parameters α1 through α4 control how much translational and rotational noise is injected. Since odometry directly measures wheel motion (rather than predicting it from motor commands), it tends to be more accurate than the velocity model.

AspectVelocity ModelOdometry Model
InputCommanded velocities (v, ω)Wheel encoder readings
When availableBefore and during motion (planning)After motion only (estimation)
AccuracyLower (commands ≠ actual motion)Higher (direct wheel measurement)
Use caseMotion planning, predictionLocalization, SLAM
Check: Why is the odometry model generally more accurate than the velocity model?

Chapter 7: Odometry Sampling

Sampling from the odometry model follows the same principle as the velocity model: perturb the parameters, then compute the new pose.

pseudocode
# Sample from odometry motion model
Input: xt-1 = (x, y, θ), ut = (δrot1, δtrans, δrot2)

# Add noise to each component
δ̂rot1 = δrot1 + sample(α1rot1| + α2trans|)
δ̂trans = δtrans + sample(α3trans| + α4(|δrot1| + |δrot2|))
δ̂rot2 = δrot2 + sample(α1rot2| + α2trans|)

# Compute new pose
x' = x + δ̂trans cos(θ + δ̂rot1)
y' = y + δ̂trans sin(θ + δ̂rot1)
θ' = θ + δ̂rot1 + δ̂rot2

return (x', y', θ')

The noise scales with the magnitude of the motion: larger motions accumulate more error. This is physically reasonable — driving 10 meters has more odometry drift than driving 1 meter.

Practical tip: When calibrating the noise parameters, drive the robot in known patterns (e.g., a square) and compare the final pose to the expected one. Repeat many times and fit the α parameters to match the observed distribution of errors. Over-estimating the noise is generally safer than under-estimating it — it makes the filter more robust to un-modeled effects.
Check: In the odometry sampling algorithm, what determines the magnitude of the noise?

Chapter 8: Motion and Maps

So far, our motion models ignore obstacles. The robot might sample a pose that's inside a wall! There are two approaches to handling this:

Rejection sampling: Sample poses from the motion model, discard any that land in occupied space, and re-sample. Simple but wasteful if many samples are invalid.

Map-informed models: Modify the motion model itself to assign zero probability to poses inside obstacles. This is cleaner but requires access to the map during the prediction step.

When does this matter? For localization with a known map, incorporating map constraints into the motion model improves accuracy. For SLAM (where the map is being built), it's harder because the map is uncertain. In practice, many implementations use the simple motion model without map constraints, relying on the measurement update to correct implausible particles.

Another subtlety: the Markov assumption says xt depends only on xt-1 and ut. In reality, there are un-modeled effects (people pushing the robot, carpet vs. tile, wheel wear). Over-estimating the motion noise provides a practical buffer against these violations.

Check: How can we prevent the motion model from sampling poses inside walls?

Chapter 9: Summary

Probabilistic motion models are the prediction engine of every Bayes filter. They transform the old belief into a predicted belief by accounting for the uncertainty in robot motion.

ModelWhen to use
Velocity modelWhen you have commanded velocities (v, ω); suitable for planning and prediction
Odometry modelWhen you have wheel encoder data; more accurate; suitable for localization and SLAM

Key lessons:

• Noise is added to control parameters (velocities or odometry), not directly to the pose.

• Noise magnitude scales with the motion magnitude — bigger moves are noisier.

• Over-estimating noise is safer than under-estimating it.

• Both density evaluation and sampling are needed, depending on the filter type.

What comes next: Chapter 6 completes the Bayes filter toolkit by developing measurement models p(zt | xt) — how sensor readings relate to the robot's pose. Together with motion models, measurement models give us everything we need for localization, mapping, and SLAM.
Check: In the motion model, noise is applied to ___, not directly to ___.