Skip to content

docs: 📝 Add section 1.2 about running a simulation and the tests - #224

Merged
ShisatoYano merged 2 commits into
ShisatoYano:mainfrom
Goldloli:docs/getting-started-run-simulations
Nov 16, 2026
Merged

ShisatoYano merged 2 commits into
ShisatoYano:mainfrom
Goldloli:docs/getting-started-run-simulations

Conversation

@Goldloli

@Goldloli Goldloli commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Part of #199 (section 1.2).

What this adds

A new page doc/getting_started/running_simulations.md, linked from the chapter page, covering the three points the issue lists for this section:

  • Running a simulation: one script under src/simulations/, run from the repository root (example: the EKF localization simulation), with what the window and the terminal output show.
  • --save-gif: which simulations write a GIF (about half of them define a GIF output), where the file goes (the simulation's own folder), and that these GIF files are the ones the gallery shows. Example with the Hybrid A* planner.
  • show_plot and the tests: each script keeps its animation behind a show_plot flag, the tests call each main() with the flag off, and . run_test_suites.sh (pytest over test/) confirms the environment is complete.

It follows the writing guide: a search-oriented first sentence, one page per section, no theory layer (the page links to Chapter 2 for the simulator itself). The chapter page's note now says the chapter is being written, and section 1.2 links to the new page, so it is nested under the chapter in the sidebar.

Verification

$ sphinx-build -W --keep-going -b html doc doc/_build/html
build succeeded.   # zero warnings; sidebar nests 1.2 under Chapter 1

$ . run_test_suites.sh
110 passed in 305.77s

$ python src/simulations/localization/extended_kalman_filter_localization/extended_kalman_filter_localization.py
Simulation start!!
Simulation finished!!   # exit 0, animation window

$ python src/simulations/path_planning/astar_hybrid_path_planning/astar_hybrid_path_planning.py --save-gif
# writes astar_hybrid_search.gif and astar_hybrid_navigate.gif into the simulation's folder

Section 1.2 was claimed in #199.

Part of ShisatoYano#199: a short, practical page for chapter 1 covering how to run a
simulation from the repository root, what the show_plot flag does, how
--save-gif writes the animation of the simulations that define a GIF
output, and how run_test_suites.sh checks the environment.
@ShisatoYano ShisatoYano added the documentation Improvements or additions to documentation label Nov 15, 2026
@ShisatoYano
ShisatoYano self-requested a review November 15, 2026 10:10
@ShisatoYano

Copy link
Copy Markdown
Owner

Thank you, @Goldloli, for writing the first section of Chapter 1! The page is short and practical, as the issue asked: one command to run, what the window and the terminal show, the --save-gif option with a real example, and the test suite as a check of the setup. The first sentence works well for search, and linking to the gallery and to Chapter 2 instead of repeating them keeps the page focused.

I checked the facts against the code: all 43 simulation scripts have show_plot = True at the top, --save-gif only takes effect when a GIF file is defined and the window is shown otherwise, and the Hybrid A* example writes the two GIFs you name. The book builds without warnings with this branch, and the links to the gallery and Chapter 2 resolve to the book pages.

Small requests before merging:

  1. "About half of the simulations define a GIF output file (most of the path planners, ...)": it is 20 of 43 scripts, but it is all the path planners (16 of 16). Since the count will change as simulations get GIF outputs, could you drop it and write something like "Some simulations define a GIF output file (all the path planners, and controllers such as MPPI and MPC)"?
  2. . run_test_suites.sh needs a bash shell. Please add that on Windows, or in any shell, pytest -l --durations=0 from the repository root does the same.
  3. "which takes a few minutes": the full suite takes about 5 to 12 minutes depending on the machine, so "several minutes" would set the right expectation.

Minor: "the unit tests run the same computation as the animation" could say "the tests", since most of them are smoke tests that run main() rather than unit tests of single functions.

🤖 Generated with Claude Code

@Goldloli

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review. All four points are addressed in 9a47e5a: the GIF count is no longer numeric and now names all path planners plus MPPI/MPC; the test section documents the bash requirement, Windows runner, and the shell-neutral pytest command; the duration is now "several minutes"; and the wording uses "the tests" rather than "unit tests". Re-verified with sphinx-build -W --keep-going -b html doc doc/_build/html (build succeeded, zero warnings).

@ShisatoYano

Copy link
Copy Markdown
Owner

Thanks for the quick update! All four points from the last review are addressed:

  1. The GIF paragraph now says "all the path planners" — I checked that every path planning simulation on main defines a GIF output, so this is accurate.
  2. The note that run_test_suites.sh needs bash, with run_test_suites.bat and pytest -l --durations=0 as alternatives, reads well and matches what both scripts run.
  3. "several minutes" — fixed.
  4. "the tests" — fixed.

I also built the book with sphinx-build -W on top of the current main with no warnings, there are no conflicts, and all CI checks have passed, so I'm merging it now. Thanks for writing section 1.2!

🤖 Generated with Claude Code

@ShisatoYano
ShisatoYano merged commit fd7fa11 into ShisatoYano:main Nov 16, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AVCBG Work Plan Nov 16, 2026
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

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants