Frenet Trajectory Generation
Werling, Ziegler, Kammel, and Thrun's "Optimal Trajectory Generation for Dynamic Street Scenarios in a Frenet Frame," presented at IEEE ICRA 2010, is one of the classic planning papers behind road-aligned trajectory sampling [1]. Its central idea is simple but powerful: do not plan directly in global coordinates when the road itself gives a natural coordinate system. Instead, project the vehicle onto a reference curve, plan longitudinal station and lateral offset , then map the selected trajectory back to Cartesian space for tracking.
The paper sits between behavior planning and low-level control. A behavior layer can request "keep speed," "follow," "merge," or "stop"; the Frenet planner turns that tactical request into a time-parameterized, smooth, collision-checked trajectory. Compared with a purely geometric path, the output includes time, speed, acceleration, heading, curvature, and enough smoothness for a feedback controller to track.
Problem & motivation
Dynamic street scenarios require more than a shortest path around static obstacles. At highway speed, a planner must decide how quickly to change lanes, whether to pass or follow, how to keep a time gap, and how to avoid a sudden obstacle without producing uncomfortable jerk. The authors argue that many earlier sampling or parametric methods could generate feasible local paths, but their parameter spaces did not necessarily contain the jerk-optimal solution. Replanning at different frequencies could therefore change the chosen transient and produce temporal inconsistency.
The paper's answer is to sample within the function class that solves an unconstrained optimal-control problem: quintic polynomials for fixed terminal position, velocity, and acceleration, and quartic polynomials for velocity-keeping where terminal position is free. The algorithm then filters these optimal free-space candidates by acceleration, curvature, road, and collision constraints. When constraints are inactive, Bellman's principle of optimality explains why the remainder of the previously optimal maneuver remains optimal at the next planning tick. That is the important conceptual contribution: the planner is sampling candidates, but the samples are structured around an optimal-control result rather than arbitrary shape parameters.
Method
Let be the road centerline or another behavior-selected reference curve, parameterized by arc length . Let be its normal vector. A vehicle position is represented as
Here is progress along the route and is signed lateral offset. At moderate and high speed, the method treats lateral and longitudinal motion as nearly decoupled, because the tangent and normal of the resulting trajectory are close to the road tangent and normal. At low speed, where nonholonomic constraints become more visible, the paper switches to , so lateral motion is parameterized by distance along the path rather than time.
The core optimal-control fact is the jerk-minimizing polynomial. For a scalar coordinate over , define
The Euler-Lagrange equation for the integrand gives , so the unconstrained minimizer is a quintic polynomial:
The first three coefficients are fixed by the start state:
The remaining coefficients satisfy
where
Equivalently,
Werling et al. use this result for lateral motion. For high-speed lane keeping or lane changes, they generate lateral candidates from the current lateral state to sampled end states
and score them with
For longitudinal behavior, the terminal target depends on the behavior mode. Following uses a constant-time-gap target behind a lead vehicle:
Stopping uses a fixed with zero terminal speed and acceleration. Merging can target the midpoint between two predicted vehicles:
Velocity keeping is different: the goal is a desired terminal speed, not a desired terminal station. The terminal position is free, so the jerk-optimal trajectory becomes quartic rather than quintic. A typical velocity cost is
The planner forms lateral and longitudinal sets, checks each candidate for acceleration limits, combines surviving pairs, transforms them back to global coordinates, rejects candidates that violate curvature or collide with obstacles, and selects the minimum weighted cost:
Collision handling is intentionally hard-gated rather than a nearby-obstacle soft penalty. The paper expands the vehicle contour and enlarges the checked contour toward the time horizon, so later portions of a trajectory maintain stronger clearance.
Architecture diagram
Figure: Plane-curve tangent and normal vectors underlying the road-aligned Frenet frame. From Wikimedia Commons, Salix alba, CC BY-SA 3.0.
Architecture details
The paper separates high-speed and low-speed trajectory generation. High-speed planning samples and independently. This gives velocity-invariant lane changes: the timing of the lateral maneuver can be chosen without rebuilding the lane change around absolute forward speed. Low-speed planning samples because nonholonomic feasibility is harder to preserve when a vehicle moves slowly and lateral motion cannot be treated as an independent offset time signal.
The implementation uses discrete sets of terminal offsets and terminal times. Figures 3, 4, and 5 in the paper show lateral movement, longitudinal target tracking, and velocity adaptation: green is the selected optimal candidate, black candidates are valid alternatives, and gray candidates are invalid. Figure 6 shows the combined global trajectory set after lateral and longitudinal pairing. Figure 7 demonstrates a simulated highway passing scenario where the method reacts by combining steering and speed changes.
The planner needs centerline geometry: orientation, curvature, and curvature derivative. The appendix derives transformations from Frenet coordinates to global heading, curvature, velocity, and acceleration. This matters because a feedback controller cannot track only points; it needs a smooth reference with curvature and speed.
The reported vehicle experiment used the autonomous vehicle Junior with a 100 ms planning cycle for long-term objectives without obstacles. The reactive obstacle-avoidance demonstration was simulation-only because the highway passing scenario was risky. The authors explicitly state that the short horizon does not replace far-sighted behavior planning. The behavior layer still needs to avoid creating critical situations whenever possible.
Datasets & results
This is a classical planning paper, not a benchmark paper with KITTI-style metrics. The evaluation is a combination of implementation on Junior and simulation of highway traffic.
| Evidence in Werling et al. [1] | What it demonstrates | Conservative reading |
|---|---|---|
| Figures 3-5 | Cyclic replanning of lateral and longitudinal candidate sets | The sampled candidates preserve smoothness and temporal consistency in the shown scenarios. |
| Figure 6 | Combined trajectory set in global coordinates | The Frenet decomposition can generate many global alternatives while keeping the road-aligned structure visible. |
| Junior implementation at 100 ms cycle | Real-time integration with a tracking controller | The non-reactive long-term objective part was implemented on a real vehicle. |
| Figure 7 simulated highway scenario | Reactive passing and braking/acceleration around predicted obstacles | The most aggressive dynamic-obstacle claims are simulation evidence, not open-road validation. |
The most durable result is methodological rather than numerical: by sampling jerk-optimal polynomial connections in a road-aligned frame, the planner gives behavior modules a small set of intuitive knobs while still producing smooth, dynamically checkable trajectories.
Worked example
Example 1: Rest-to-rest lateral lane change
Problem: Generate a lateral lane-change profile from m to m in s, with zero initial and final lateral velocity and acceleration.
- The start conditions give
- The end residuals are
- Substitute into the closed-form coefficients:
- The lateral trajectory is
- Check the endpoint:
Answer: the quintic moves one 3.5 m lane width in 4 s with zero endpoint lateral speed and acceleration.
Example 2: Following target from a time-gap law
Problem: A lead vehicle is at m and travels at m/s with approximately constant speed. The desired standstill distance is m and the time gap is s. Compute the target station now and after 3 s.
- At , the desired following distance is
- The target station is therefore
- With constant lead speed, after 3 s:
- The desired gap is unchanged because speed is unchanged, so
Answer: longitudinal candidates for following should be built around a moving target that goes from 15 m to 75 m over the 3 s horizon.
Code
import numpy as np
def quintic_coeffs(p0, v0, a0, p1, v1, a1, T):
c0 = p0
c1 = v0
c2 = 0.5 * a0
b0 = p1 - p0 - v0 * T - 0.5 * a0 * T**2
b1 = v1 - v0 - a0 * T
b2 = a1 - a0
c3 = 10 * b0 / T**3 - 4 * b1 / T**2 + 0.5 * b2 / T
c4 = -15 * b0 / T**4 + 7 * b1 / T**3 - b2 / T**2
c5 = 6 * b0 / T**5 - 3 * b1 / T**4 + 0.5 * b2 / T**3
return np.array([c0, c1, c2, c3, c4, c5])
def eval_poly(c, t):
powers = np.vstack([t**i for i in range(len(c))])
return c @ powers
def jerk_cost(c, T, steps=200):
t = np.linspace(0.0, T, steps)
jerk = 6 * c[3] + 24 * c[4] * t + 60 * c[5] * t**2
return np.trapz(jerk * jerk, t)
lane_width = 3.5
times = [3.0, 4.0, 5.0]
candidates = []
for T in times:
coeff = quintic_coeffs(0.0, 0.0, 0.0, lane_width, 0.0, 0.0, T)
cost = 0.2 * jerk_cost(coeff, T) + 0.5 * T
candidates.append((cost, T, coeff))
best_cost, best_T, best_coeff = min(candidates, key=lambda item: item[0])
print(f"best duration: {best_T:.1f} s")
print(f"coefficients: {best_coeff}")
Common pitfalls
- Treating Frenet planning as only a coordinate transform. The important part is the structured optimal-control candidate set and the cost/filtering pipeline.
- Forgetting that high-speed decoupling is an approximation. At low speed or near extreme curvature, or a direct vehicle-model planner may be needed.
- Adding obstacle proximity directly into the comfort cost without care. Werling et al. prefer hard collision filtering with expanded contours because soft obstacle penalties can create hard-to-tune behavior.
- Assuming the local planner replaces behavior planning. The paper is explicit that the short horizon should not be asked to make far-sighted tactical decisions.
- Ignoring curvature after transforming back to Cartesian space. A smooth pair can still imply an infeasible global curvature if the reference path or offset is aggressive.
Connections
- Motion planning
- Decision making and behavior planning
- Control, PID, MPC, pure pursuit, and Stanley
- Sampling-based motion planning
- MPC for autonomous driving
- Prediction and motion forecasting
- Systems of ODEs and phase plane
References
[1] M. Werling, J. Ziegler, S. Kammel, and S. Thrun, "Optimal Trajectory Generation for Dynamic Street Scenarios in a Frenet Frame," in Proc. IEEE International Conference on Robotics and Automation, 2010, pp. 987-993.
[2] J. Ziegler and C. Stiller, "Spatiotemporal State Lattices for Fast Trajectory Planning in Dynamic On-Road Driving Scenarios," in Proc. IEEE/RSJ International Conference on Intelligent Robots and Systems, 2009.
[3] Y. Kuwata, G. A. Fiore, J. Teo, E. Frazzoli, and J. P. How, "Motion Planning for Urban Driving Using RRT," in Proc. IEEE/RSJ International Conference on Intelligent Robots and Systems, 2008.
[4] D. Ferguson, T. M. Howard, and M. Likhachev, "Motion Planning in Urban Environments," Journal of Field Robotics, vol. 25, no. 11, pp. 939-960, 2008.