Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Run models from the command line

Select the ArduCopter version

The Copter rehosting hooks are version-specific. Select the firmware and its matching hook/config set together with the version runner:

nix develop
python utils/run_copter_version.py --list
python utils/run_copter_version.py --version 4.7.0
python utils/run_copter_version.py --version 4.6.2

4.7 and 4.6 are accepted when they identify exactly one manifest entry. Before rendering the configuration, the runner verifies the firmware and board ROMFS-defaults SHA-256 values recorded in configs/copter_versions.toml; this prevents a firmware binary from being combined accidentally with hooks or defaults for another release. Use --prepare-only to render and verify without starting QEMU, and --overlay to add a normal FastDyn configuration overlay.

Choose an environment, then generate a config for the firmware and plant you want:

VehicleBase configModelMission completion
Copter 4.7.0configs/copter470.tomlFastDyn.CopterControl loop, heartbeat, and GPS verified; EKF mission readiness pending
Copter 4.6.2configs/copter462.tomlFastDyn.CopterFinal landing
Roverconfigs/rover462.tomlFastDyn.RoverFinal waypoint reached

For Rover:

fastdyn-config --base configs/rover462.toml --output out/rover.toml
fastdyn run -c out/rover.toml -o out/rover/work

Run examples one at a time: their default MAVLink, viewer, and monitor ports are shared. Plane’s wrapper uses the library’s three-wheel fixed-wing template, but its contact events cannot yet be exported by the pinned compiler. Its configuration and source are included for inspection; use Copter or Rover for a runnable firmware simulation.

Build an FMU without starting firmware

Use the same TOML for compilation and execution:

python utils/build_fmi3_fmu.py --config out/copter.toml --skip-submodules

The first mission’s Copter writes out/fmi3/Copter/FastDyn_Copter.fmu. --no-build generates source and metadata without compiling a shared library. The current Rumoca also emits a portable source FMU; FastDyn normally compiles its native library on first use and caches it beside the archive.

To compile the current array-based model directly:

rumoca compile modelica/FastDyn/Copter.mo \
  --model FastDyn.Copter \
  --source-root modelica \
  --source-root third_party/common/modelica_models \
  --output out/manual/Copter --target fmi3

The direct command compiles the Modelica defaults. FastDyn applies the numeric parameter overrides in TOML when it initializes the FMU.

Choose another model

Add another [FMU.models.<name>] entry with its model, model_file, source_roots, and a distinct output directory. Set [FMU].active to that name, or override the selection for one run:

fastdyn run -c out/copter.toml --fmu small_quad -o out/small_quad/work

That command requires an entry named small_quad in your TOML. A compatible plant must expose FastDyn’s PWM and sensor interface. Copy the wrapper in modelica/FastDyn/Copter.mo for a new quadrotor plant, preserving its output names, dimensions, units, and body FRD/NED conventions. An arbitrary Modelica model does not automatically implement that interface.

Run options

OptionPurpose
-c, --config PATHRequired TOML file
-o, --work-dir PATHGenerated firmware/plugin configuration and run output
--fmu NAMESelect a named FMU entry for this run
--no-build-fmuUse an existing artifact without automatic compilation
--no-run-processesLaunch QEMU without configured MAVProxy or mission helpers
-p, --persist-work-dirRetain the existing generated work directory
-m, --map-file PATHSupply a symbol map
-s, --svd PATHSupply peripheral descriptions

Use fastdyn run --help and python utils/build_fmi3_fmu.py --help for the complete command-line help. Keep persistent model settings in TOML; CLI overrides are useful for individual runs.