Skip to content

Build & Test

racing-drone is C++20 and builds with CMake ≥ 4.0 and Ninja, on GCC, Clang, and MSVC, using the same presets as the sibling repos.

Terminal window
cmake --preset gcc-debug # also: gcc-release, clang-debug, clang-release, msvc, msvc-ninja, ...
cmake --build --preset gcc-debug
ctest --preset gcc-debug

Every baseline in baselines/ becomes four executables: flight_stack_<name>, replay_<name>, sitl_<name>, and sitl_batch_<name> (ADR 0001). B0 also gets precision_sweep_b0-gt-pid, which runs its stack in each scalar type of the precision sweep. With baseline B0:

Terminal window
B=build/gcc-debug/apps
$B/sitl_b0-gt-pid --scenario scenarios/b0-determinism.yaml --out run.brlog # simulate, log every input and output
$B/score_log --log run.brlog --speed-limit 5 # score the run: laps, gate errors, failures
$B/replay_b0-gt-pid --log run.brlog --out replay.brlog --verify # reproduce the outputs record for record
$B/log_dump --log run.brlog --out-dir run # every channel as CSV, for plotting
$B/trace_export --log run.brlog --scenario scenarios/b0-determinism.yaml --out run.json # a replay for the docs site's player
$B/sitl_batch_b0-gt-pid --scenario scenarios/b0-nominal.yaml --seeds 10 --min-success 1 # many seeds, as the gates run
$B/precision_sweep_b0-gt-pid --scenario scenarios/b0-nominal.yaml --seeds 10 --out-dir sweep # the stack in float, posits, bfloat16, ...
$B/flight_stack_b0-gt-pid --course courses/a2rl-2025.yaml --vehicle vehicles/rp1.yaml --cycles 10
$B/sitl_b0-gt-pid_graph --scenario scenarios/b0-nominal.yaml --print-graph mermaid # the graph the stack runs, as a flowchart
$B/sitl_b0-gt-pid_graph --scenario scenarios/b0-determinism.yaml --out run.brlog --trace run.brtrace # also every edge

Run sitl_<name> first: replay_<name>, score_log, log_dump, and trace_export read the log it writes.

A baseline’s graph build, sitl_<name>_graph, prints the graph its stack runs instead of flying: --print-graph text gives the canonical form the log’s composition_hash is the hash of, and --print-graph mermaid a flowchart that GitHub renders in a ```mermaid block. anatomy’s reading a graph explains the chart. The slot build, sitl_<name>, has no graph and refuses the option.

--trace <run.brtrace> also writes every value the graph’s firings write, edge by edge, beside the log, and anatomy’s trace_compare --a <a.brtrace> --b <b.brtrace> (built in _deps/anatomy-build/apps/) names the first edge on which two runs differ (anatomy flow/trace.hpp). The two runs may be of different baselines: b0-gt-pid’s and b0-shaped-pid’s first differ inside the controller, the composite their graphs differ in. The slot build refuses --trace too.

With the msvc preset, the harnesses are under Baselines/<name> in the solution, and score_log, log_dump, and trace_export are under Tools. Each starts in the source root with debugger arguments filled in (the table in the README). Working through the stack in Visual Studio walks through one closed loop, its log, many seeds, the precision sweep, and the tests.

This site is generated from docs/. To preview it:

Terminal window
cd docs-site
npm ci
npm run dev # regenerates the pages from docs/, then serves them

Next: repository layout.