Skip to content

docs: ✏️ Move Stanley into chapter 4 and rewrite MPC and MPPI as chapter 10 - #214

Merged
ShisatoYano merged 1 commit into
mainfrom
docs/book-ch4-ch10-control
Nov 8, 2026
Merged

ShisatoYano merged 1 commit into
mainfrom
docs/book-ch4-ch10-control

Conversation

@ShisatoYano

Copy link
Copy Markdown
Owner

Closes #170. Closes #75.

Change

Chapter 4

  • doc/4_path_tracking/4_1_stanley_controller.md moves to doc/path_tracking/stanley.md as section 4.3, linked from the chapter page. Its figure script moves with it.

Chapter 10: the MPC and MPPI design documents are rewritten as the theory layer of the writing guide.

  • 10.3 MPC (doc/optimal_control/mpc.md):
    • The prediction model (1). It is Euler with the steering angle as input, slightly simpler than the simulator's update.
    • The reference spaced by $v,\Delta t$ along the course.
    • The cost (2) and the constrained problem (3), solved with IPOPT, CasADi and do-mpc.
    • The receding horizon loop, limits, literalincludes of _build_model and _build_mpc, and measured experiments.
  • 10.4 MPPI (doc/optimal_control/mppi.md):
    • Sampling (1), the sample cost (2), the weights (3) and the update (4), and what $\lambda$ does.
    • A comparison table of MPC and MPPI, limits, literalincludes, and a table of measured experiments.
    • New figure figures/mppi_samples.py: one MPPI update with the samples shaded by weight. It replaces mppi.png, which was copied from a blog (the writing guide doesn't allow copied figures).
  • The texts follow the code where the old documents didn't:
    • MPC's set_rterm() penalizes only the change of the input; the code has no separate penalty on its size.
    • The default v_min is 0, not −1.
    • MPPI's errors are measured to the nearest course point, not a time-indexed reference.
  • Symbols: a new "Optimal control" table in NOTATION.md. Weights are $W$, not $Q$ and $R$, which the book uses for noise. Samples are $M$, not $K$, which is the Kalman gain.
  • The authors are credited at the end of each section (Mohit Kumar for MPC and the first documents, Erwin Lejeune for the MPPI controller).

The stopgaps listed in #170

  • SECTION_PAGES is replaced by a rule in add_section_toctree(): a chapter page (<chapter>/index.md) gets a hidden toctree of the pages in its own folder that it links to, in link order. A new section only needs a link from its chapter page.
  • suppress_warnings = ["myst.header"] is removed: every page now starts at H1.
  • The front page's tab title no longer repeats the book title.
  • DESIGN_DOCUMENT.md and its exclude_patterns entry are removed. CLAUDE.md points to the book instead.

Check

  • The book builds with -W, with no warnings and no suppressed warning; test_book_chapters.py passes.

  • All 26 display equations of the built book render in MathJax 3.

  • The sidebar nests "4.3 Stanley" under chapter 4, and 10.3 and 10.4 under chapter 10.

  • Experiments, run headless on the same course:

    Run Average distance Largest distance Steering change
    MPC as set in the simulation 0.13 m 1.0 m 0.108 rad
    MPC with $N = 5$ 0.19 m 2.4 m 0.077 rad
    MPPI as set in the simulation 0.16 m 1.3 m 0.064 rad
    MPPI with $M = 50$ 0.36 m 2.3 m 0.110 rad
    MPPI with $\lambda = 5$ 0.18 m 0.8 m 0.146 rad
    MPPI with $\lambda = 500$ 0.42 m 2.0 m 0.034 rad
    MPPI without moving average 0.17 m 1.0 m 0.202 rad

    The steering change is the root mean square of the step-to-step difference. Timing: one MPC solve takes 14 ms (median) and at most 47 ms. One MPPI update takes about 1.3 s, measured alone.

After merge

Issues #199–#206 link to the old Stanley page (4_path_tracking/4_1_stanley_controller.html). Their links need updating to path_tracking/stanley.html.

🤖 Generated with Claude Code

…ter 10

Stanley moves to doc/path_tracking/stanley.md as section 4.3. The MPC
and MPPI design documents become sections 10.3 and 10.4 of the theory
layer: the problems they solve, written with the code's actual cost
(input changes only for MPC, nearest-point errors for MPPI), measured
experiments instead of claims, and an MPPI figure drawn by a script in
place of an image copied from a blog.

This also removes the stopgaps of #170: chapter pages now nest the
section pages they link to (no fixed SECTION_PAGES), every page starts
at H1 so the myst.header suppression goes, the front page's tab title
no longer repeats the book title, and DESIGN_DOCUMENT.md is replaced by
the book.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ShisatoYano ShisatoYano added the documentation Improvements or additions to documentation label Nov 8, 2026
@ShisatoYano ShisatoYano self-assigned this Nov 8, 2026
@ShisatoYano
ShisatoYano merged commit 963f567 into main Nov 8, 2026
5 checks passed
@ShisatoYano
ShisatoYano deleted the docs/book-ch4-ch10-control branch November 8, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move design document chapters 1 to 4 into the book [Documentation]: MPPI and MPC path tracking

1 participant