Navigation · Theory · M5
M5-T1 — Path versus Trajectory
A path says where to go. A trajectory says where to be, and when.
A planner hands Scout a line on the map. A controller cannot follow a line: it needs to know how fast to move along it, and how the speed may change. Adding time turns a path into a trajectory, and that is what separates a drawing of a route from an instruction a robot can execute.
Learning objectives
After this lesson, you should be able to:
- State the difference between a path and a trajectory and what each contains.
- Describe the continuity of a path (position, heading, curvature) and what it means for a robot that cannot turn on the spot.
- Build a trapezoidal speed profile and compute its times and distances.
- Explain why a trajectory gives a controller something to be late or early against.
The intuition
A road map shows the route from the pharmacy to ward 3. A timetable says when to be at each junction. The map is a path; the map plus the timetable is a trajectory. Two drivers can take the same route, one hurrying and one crawling, and the map cannot tell them apart.
Robots need the timetable for three reasons. The motors have limits, and a limit is a statement about change of speed over time. Turning at speed needs sideways acceleration that depends on how fast the robot goes (lesson M5-T3). And a controller needs a moving target: the path says where the robot should be laterally, the trajectory also says where it should be along the path right now.
The mathematics
What each one contains
| Path | Trajectory | |
|---|---|---|
| Parameter | Arc length s (or any index) | Time t |
| Content | Poses (x, y, θ) along the way | Poses plus speed, acceleration, often curvature, at each time |
| Question it answers | Where may the robot go? | Where should it be at time t, and how fast? |
| Made by | Global planner, smoothing (lesson M5-T2) | Path plus a speed profile (lesson M5-T3) |
Path-velocity decomposition
A common way to build a trajectory is to split the problem: first choose the path, then choose how to move along it. Write the path as a function of arc length, then choose s(t):
- s(t)
- distance travelled along the path at time t, in metres.
- v(t)
- speed along the path, in m/s.
- κ(s)
- curvature of the path at s. A circle of radius R has κ = 1/R.
- ω(t)
- turn rate the robot needs, in rad/s.
Given the path and the speed profile, the commands follow: a differential-drive robot with track width b drives its wheels at v ∓ ω·b/2.
How smooth must the path be?
| Class | Continuous | Means for the robot |
|---|---|---|
| G0 | Position | A polyline. At every vertex the heading jumps, so the robot must stop and turn on the spot (a car-like robot cannot at all). |
| G1 | Position and heading | No stopping to turn. Curvature jumps from 0 to 1/R at the start of a bend, so the steering must change instantly. |
| G2 | Position, heading and curvature | Steering changes smoothly; the path can be tracked at speed. |
The trapezoidal speed profile
The simplest useful profile accelerates at a, cruises at vmax and brakes at the same rate:
Its acceleration jumps from 0 to a and back, which is a jerk of infinite size. Real profiles round the corners (an S-curve) with a jerk limit j, which adds a ramp time of a/j at each change of acceleration.
A worked example
A 12 m corridor. Scout drives straight to the door of ward 3 with vmax = 1.2 m/s and a = 0.6 m/s² for both speeding up and braking.
Where is Scout at t = 5 s? Two seconds of speeding up cover 1.2 m, then 3 s at 1.2 m/s cover 3.6 m: s(5) = 4.8 m. At t = 11 s braking has lasted 1 s, so v = 1.2 − 0.6 × 1 = 0.6 m/s and the remaining distance is 0.5 × 0.6 × 1² = 0.3 m.
A 1.5 m hop. Here 2 · dacc = 2.4 m is longer than the route, so Scout never reaches 1.2 m/s: vpeak = sqrt(0.6 × 1.5) = 0.949 m/s and the trip takes 2 × 0.949 / 0.6 = 3.16 s.
Why the timetable matters. If the controller is 0.5 s behind the trajectory at cruise, it is 1.2 × 0.5 = 0.6 m behind where it should be along the path, even if it is exactly on the line. A path alone has no notion of being behind. On a bend of radius 1.5 m at 1.2 m/s the robot needs ω = κ·v = 1.2 / 1.5 = 0.8 rad/s; with a track width of 0.4 m the wheels run at 1.2 ∓ 0.8 × 0.2 = 1.04 and 1.36 m/s.
Lab M5-L2 builds this for a route with bends, and its stage 3 turns the profile into arrival times.
Engineering implications and limitations
Who owns the timing?
Some stacks make the planner produce a full trajectory. Others, including the common ROS 2 arrangement, pass a path to a controller that picks the speed itself, using a velocity limit and its own rules for slowing down. Both are valid. The mistake is to leave nobody in charge: a path with no one limiting speed on bends tips the tray (lab M5-L2).
Re-timing after changes
Whenever the path changes (a replan, a smoothing pass), the speed profile must be recomputed. A profile built for the old path is wrong for the new one in exactly the places where the path moved.
Time or distance as the clock
A reference tied to the clock makes the robot catch up after a delay, and a reference tied to progress along the path does not. For a delivery robot waiting politely behind a person, progress-based is safer: the target does not run away while Scout stands still.
Keep the limits honest
The limits in the profile (speed, acceleration) should be somewhat below what the hardware does, so the controller has room to correct. A profile that asks for 100 % of the motor cannot be tracked.
Common misconceptions
“A smooth path is a trajectory.”
A smooth path has no time on it. Two robots can drive the same smooth path and one will tip the tray.
“Slowing down for a bend is the controller’s job.”
The controller only reacts. Slowing down before the bend needs the curvature ahead, which the speed profile has and a one-point controller does not.
“The trapezoid always reaches the top speed.”
On a short route it never does. It becomes a triangle with a peak of sqrt(a·L).
“Tracking error is the distance to the line.”
That is the cross-track error. Along the path the robot can also be early or late against the timetable.
Engineering takeaways
- A path is geometry; a trajectory is geometry plus time, speed and acceleration.
- Path-velocity decomposition: choose the path, then s(t); ω = κ·v follows.
- A polyline is G0: the robot must stop to turn. Tracking at speed needs a path whose heading, and ideally curvature, are continuous.
- A trapezoid has tacc = v/a, dacc = v²/(2a), and becomes a triangle with peak sqrt(a·L) when the route is short.
- A timetable gives the controller something to be early or late against, and the planner something to re-time when the path changes.
References and further reading
The path-velocity decomposition and the textbook treatment of motion planning.
- K. Kant and S. Zucker, “Toward Efficient Trajectory Planning: The Path-Velocity Decomposition”, The International Journal of Robotics Research, 5(3), 1986.
- S. M. LaValle, “Planning Algorithms”, Cambridge University Press, 2006, chapter 14 (differential constraints).
- B. Paden, M. Čáp, S. Z. Yong, D. Yershov and E. Frazzoli, “A Survey of Motion Planning and Control Techniques for Self-Driving Urban Vehicles”, IEEE Transactions on Intelligent Vehicles, 1(1), 2016.
Knowledge check
Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
A route is 8 m long. Scout accelerates and brakes at 0.5 m/s² and could cruise at 1.2 m/s. Does it reach 1.2 m/s?
Explanation
Speeding up to 1.2 m/s takes 1.2² / (2 × 0.5) = 1.44 m and so does braking, 2.88 m in all, less than 8 m. Yes, with 5.12 m of cruising.
Question 2
The same robot has a 2 m route. What is its peak speed and the trip time?
Explanation
2 × 1.44 = 2.88 m is more than 2 m, so the profile is triangular. vpeak = sqrt(0.5 × 2) = 1.0 m/s and T = 2 × 1.0 / 0.5 = 4.0 s.
Question 3
A path has a 90° corner as a polyline vertex. Why can a car-like robot not follow it exactly, however slowly?
Explanation
The heading jumps by 90° at the vertex, so the path is only G0. A car-like robot cannot turn on the spot and has a minimum turning radius, so it must round the corner.
What’s next
Next: how to turn a jagged grid path into a smooth one without hitting a wall.
Related content
Nothing below is required to finish this lesson.
- LabM5-L2: Build a Velocity Profile
Give a path a speed at every point so Scout slows for corners and stops exactly at the door.
Get notified when the next lesson and new labs are released.
One email per new lesson or lab.