Skip to content

Add Frenet optimal trajectory planning - #289

Draft
guptuv wants to merge 6 commits into
ShisatoYano:mainfrom
guptuv:add-frenet-optimal-trajectory
Draft

guptuv wants to merge 6 commits into
ShisatoYano:mainfrom
guptuv:add-frenet-optimal-trajectory

Conversation

@guptuv

@guptuv guptuv commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a Frenet optimal trajectory planner (Werling et al., ICRA 2010) as a new sample program, and lists it as section 13.1 of the planned Lane Change chapter (#118).

Each cycle the planner samples lateral offsets × horizons × end speeds in the Frenet frame of the course. Lateral motion is a quintic polynomial and longitudinal motion is a quartic ("velocity keeping"). It rejects paths that exceed speed, acceleration or curvature limits or come too close to an obstacle, keeps the one with the lowest jerk + time + deviation cost, and follows it with Pure Pursuit. It plugs into FourWheelsVehicle as a controller, like the existing trackers.

Files

  • src/components/plan/frenet_optimal_trajectory/polynomials.py: QuinticPolynomial, QuarticPolynomial
  • src/components/plan/frenet_optimal_trajectory/frenet_optimal_trajectory_planner.py
  • src/simulations/path_planning/frenet_optimal_trajectory_planning/frenet_optimal_trajectory_planning.py: a curved lane with 4 static obstacles (Title/Description/Author docstring for the gallery)
  • test/test_frenet_optimal_trajectory_planning.py: smoke test (show_plot = False)
  • doc/lane_change/index.md: adds the Sections list with 13.1
  • pyrightconfig.json, .devcontainer/devcontainer.json: regenerated with generate_pyrightconfig.py

Closes #290

How I checked it works

  • Uses only numpy and matplotlib. New functions have type hints, and units are in the names.
  • Checked headless: the vehicle passes all four obstacles and keeps at least 2.5 m from them.
  • The new test, test_book_chapters.py and test_generate_example_gallery.py pass. The full suite passes too (143 tests; this environment has no do-mpc, so the MPC test couldn't run).
  • Ran the simulation headless (show_plot = False) and as an animation, and looked at the GIF below.
  • Also ran the whole change in a Google Colab notebook (fresh clone, new files, pytest).

Images

Frenet optimal trajectory demo

@guptuv guptuv changed the title Add Frenet optimal trajectory planner component Add Frenet optimal trajectory planning Nov 25, 2026
@ShisatoYano

Copy link
Copy Markdown
Owner

Thank you, @guptuv! As I wrote in #294, let's review your four PRs one at a time, starting with DWA (#294). Could you convert this one to a draft for now? I'll come back to it after #294 is merged. It isn't a rejection: the proposal fits the book, and the order is only about review time.

🤖 Generated with Claude Code

@guptuv
guptuv marked this pull request as draft November 25, 2026 15:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Frenet optimal trajectory planning (Lane Change chapter)

2 participants