Skip to content

Tools

The server exposes 45 tools. This page is generated from the server itself: names, parameters, defaults, descriptions and result types are read from the tool definitions, so they match the code that ships. The descriptions are written for the calling agent, and they are the source of truth for behaviour.

Tools marked read-only change nothing. Destructive ones stop a SITL. A failure the caller can act on (a busy instance, an unknown mode, a refused request) comes back as a tool error whose message says what to do; an arm the autopilot refuses comes back as a normal result with armed: false and the autopilot’s own reason.

Every tool that waits returns within wait_cap_s, about 85 s. A long flight is a loop of bounded waits, each passing since_seq back in.

A session is one SITL and the link to it. open_sitl returns the session_id the rest take.

open_sitl

Start a SITL on a leased instance and keep a MAVLink link to it. Returns once home is set, with the session id every other session tool takes. This server's thread then keeps the link alive (GCS heartbeat, RC overrides) between calls. Throttle starts low (RC3 1000). Channel 5 starts at 1800, which is a flight-mode switch position on many parameter sets (FLTMODE_CH 5), so a vehicle may boot in whatever mode that maps to: pass rc={5: <pwm>} to choose, and arm(mode=...) switches before arming either way. The six FLTMODE1 to FLTMODE6 positions are PWM below 1231, 1231 to 1360, 1361 to 1490, 1491 to 1620, 1621 to 1749, and 1750 up; pick a value inside a band (1425 is position 3).

At speedup N, every second you spend between calls passes N sim seconds with the last RC held, so by default (idle_speedup auto) a session above speedup 1 runs at 0.05, nearly still, whenever no call is in flight, which makes your pace irrelevant to the flight; pass idle_speedup="off" to let it run on. Close it with close_sitl; idle sessions close themselves after session_idle_s.

ParameterTypeDefaultMeaning
presetstr | NoneNonea preset (list_presets) or a path to a preset .json: its arguments apply first, and any argument given here overrides them (set, rc and wind merge key by key)
modelstr"quadplane"SITL frame, e.g. "quadplane" or "plane", or "<frame>:<path to a model .json>" for a frame that reads a model file
paramslist[str][]parameter files, loaded in order (absolute or ~ paths)
setdict[str, float]{}parameters to set at boot, loaded after the files
lualist[str][]Lua scripts to load (paths)
run_fileslist[str][]files SITL reads from its working directory by name (a box.json for SIM_BOX_ENA, say), copied in under their own names; their sha256s go into provenance and the recipe, and repro refuses a file that has changed since
speedupfloat10simulation speed against real time, 1 to 50
rcdict[int, int]{}RC override at boot, channel (1 to 8) to PWM, on top of the default 1500, 1500, 1000, 1500, 1800, 1500, 1500, 1500
idle_speedupfloat | "auto" | "off""auto"the speed SITL runs at whenever no tool call is in flight, so your thinking time does not move the sim: auto (0.05 when speedup is above 1, else off), off (always run at speedup), or a speed from 0.05
windWindModel | NoneNonewind and gusts from the start, as set_wind takes them
binarystr | NoneNonefly another SITL binary (another build, to compare against); default the server's
treestr | NoneNonefly the binary built in this ArduPilot tree (<tree>/build/sitl/bin/<the server's binary name>)
instanceint | NoneNonea pool instance; omit to lease the first free one
keep_logs"never" | "last" | "all""last"dataflash logs to keep at close: never, last or all
labelstr | NoneNonea name for the session and its log
default_paramsbool | NoneNoneprepend the frame's default parameter files from the ArduPilot tree (what sim_vehicle.py loads) and turn on SITL's simulated battery (BATT_MONITOR 4) unless set says otherwise; default: only when params is empty
record_video"fpv" | "chase" | "pip" | NoneNonerender the kept log to an MP4 at close, beside the log: fpv (nose camera with a HUD), chase (from behind), or pip (fpv with chase inset)
exactboolFalsefor fly_exact: pin SITL's clock, log from boot and send no RC overrides, so a mission flown with fly_exact repeats bit for bit (a preset's rc is left out, with a warning). Takes steady wind and gusts sitl, not dryden (driven from here, so not repeatable)
airframestr | NoneNonefor render_film: an airframe description (JSON) to draw this session's log with; a preset that flies a real airframe names its own

Returns OpenResult

snapshotread-only

The session's state now: armed, mode, height, attitude, speeds, battery, RC sent, servo outputs, mission item, recent autopilot texts, the speed SITL runs at (and how many people watch its video feed, which holds it at real time), and seq for wait_until's since_seq.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
textsint10latest STATUSTEXTs to include

Returns Snapshot

get_paramread-only

Read parameters from the autopilot: {name: value}. A name the autopilot does not have fails after about 5 s ("no PARAM_VALUE"); names longer than 16 characters (MAVLink's limit) are refused before anything is sent.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
nameslist[str]requiredparameter names, e.g. ["Q_A_RAT_RLL_P", "SIM_WIND_SPD"]

Returns dict[str, float]

set_param

Set parameters, live, and return {name: value} as the autopilot reports them back, so a value it clamped or rejected shows. Names longer than 16 characters are refused. Some parameters only take effect after a reboot (Q_ENABLE, frame and sensor types): set those at boot with open_sitl's set instead. Refused while a step program runs.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
paramsdict[str, float]requiredname to value, e.g. {"Q_A_RAT_RLL_P": 0.25, "BATT_MONITOR": 4}

Returns dict[str, float]

set_mode

Switch flight mode (QLOITER, QHOVER, QLAND, QRTL, AUTO, FBWA, RTL, ...) and confirm it from the autopilot's HEARTBEAT within 5 sim seconds. Returns a snapshot; if the autopilot kept its old mode, fails naming that mode and its latest texts (a refused mode change usually says why there).

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
modestrrequiredflight mode name, case-insensitive, e.g. "QLAND"

Returns Snapshot

arm

Throttle low, switch mode, arm, retrying every 3 sim seconds while pre-arm checks settle. On refusal returns armed false with the autopilot's last PreArm text. Heights are measured from where it armed.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
modestr | NoneNonemode to arm in; default the current one
timeout_sfloat60sim seconds to keep trying

Returns ArmResult

disarmdestructive

Disarm now, forced: in the air the motors stop and the aircraft falls. To come down, set_mode QLAND and wait_until disarmed (ArduPilot disarms itself on touchdown); use this on the ground, or to end a flight that has gone wrong. Returns a snapshot.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
reset_batteryboolTruefit a fresh pack and zero consumed mAh (and clear injected wind and engine faults), so the next arm is not refused

Returns Snapshot

set_speedup

Change how fast the session's SITL runs, live. Slow it down to think or to watch a manoeuvre closely, speed it up for cruise legs. wait_until's then_speedup does the same the instant a condition is met.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
speedupfloatrequiredsimulation speed against real time, 0.05 to 50; SITL cannot pause, but 0.05 is nearly still

Returns Snapshot

rc_override

Set sticks: the RC override this server sends continuously, held until changed. Only the channels given change. With ArduPilot's default mapping channel 1 is roll, 2 pitch, 3 throttle and 4 yaw (1500 centred, throttle 1000 low); 5 is often the flight-mode switch. In QLOITER and QHOVER the throttle stick commands climb rate, so 1500 holds height. Returns the eight channels now sent. Refused while a step program runs (it owns the sticks).

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
channelsdict[int, int]{}channel (1 to 8) to PWM (800 to 2200), e.g. {3: 1700} for throttle; held until changed
enabledbool | NoneNonefalse stops sending overrides altogether
script_channelslist[int] | NoneNonechannels a Lua script drives: 65535 goes out there so the override does not overwrite the script

Returns dict

upload_mission

Upload a mission in metres from home. Home goes in as item 0, so items[i] is mission item i + 1. Retries while ArduPilot ignores mission traffic after boot.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
itemslist[MissionItem]requiredthe mission after home, in order; positions in metres from home

Returns dict

wait_until

Wait until a condition holds, its timeout of sim time passes, or SITL dies. Always returns a snapshot and a reason: met, timeout, died, cap, or closed if the session was closed meanwhile. One call blocks at most about 85 s of wall time (reason cap): loop with since_seq for longer flights.

At speedup N every second you spend between calls is N sim seconds with the old RC still held, so "wait, then react" overshoots. then_rc, then_mode and then_speedup react in the same tick the condition is met, applied by the server: wait_until altitude >= 5 with then_rc {3: 1500} stops a climb at 5 m. For timing, use sim_time with a target read off snapshot.t_sim_s ("hover until t = 230"), not time, which counts from this call. When the wait settles inside the server (met, timeout, died) the snapshot is taken in that same tick: a measurement at that moment.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
condition"altitude" | "airspeed" | "mode" | "armed" | "disarmed" | "text" | "waypoint" | "time" | "sim_time" | "landed"requiredaltitude (height_m), airspeed, waypoint (mission item), time (sim seconds to let pass, counted from this call), sim_time (until the autopilot clock reads value, as in snapshot.t_sim_s), mode, text (a STATUSTEXT containing value), armed, disarmed, landed
valuefloat | str | NoneNonethe number, mode name or text to wait for
op">=" | "<=" | "=="">="comparison for numeric conditions
timeout_sfloat60sim seconds before reason timeout
since_seqint | NoneNoneseq of the last snapshot you saw: a text that arrived after it counts even if it came before this call
then_rcdict[int, int] | NoneNoneRC override to apply the instant the condition is met, e.g. {3: 1500} to stop a QLOITER climb at the target height
then_modestr | NoneNonemode to switch to the instant the condition is met
relativeboolFalsesim_time only: value is seconds after the tick the previous wait on this session settled (hover 15 s after the climb ended)
then_speedupfloat | NoneNoneSIM_SPEEDUP to set the instant the condition is met; 0.05 holds the moment nearly still while you decide what to do next

Returns WaitResult

close_sitldestructive

Kill the session's SITL, free its instance, and move the kept dataflash logs out to the server's log directory. A session that died is removed the same way; its logs were already handled by its own keep_logs when it died, so keep_logs here applies only to a live session. A kept log may push older ones past the log budget (pruned lists them). Beside the kept log goes its recipe (<stem>.recipe.json: the open arguments as they took effect and every acting call in order), which repro flies again. If open_sitl asked for record_video, video carries the render it started; video_status follows it to the MP4.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
keep_logs"never" | "last" | "all" | NoneNoneoverride the session's keep_logs

Returns CloseResult

list_sessionsread-only

This server's sessions, open or died (a died session stays until close_sitl), each with its instance, label, pid, run directory, speeds, keep_logs and how long it has been idle (idle sessions close after session_idle_s). SITLs that other servers or scripts run are in list_instances, not here.

Returns list[SessionInfo]

list_presetsread-only

The open_sitl presets this server can find, each with its name, file, description and model. A preset is a JSON file of open_sitl arguments that a project ships beside its model and parameter files (paths inside it are relative to it); open_sitl(preset="<name>") uses one. Searched: MCARDUPILOT_PRESET_DIRS, then <data_dir>/presets.

Returns list[dict]

A step program runs a manoeuvre inside the server, applying each step’s actions in the tick it starts. The step fields are on Step, wind and mission fields.

fly_steps

Fly a sequence of steps inside the server, with no round trip between them. A step applies its actions (rc, mode, speedup, params) in the tick it starts, then waits until its condition holds (the same conditions as wait_until) or timeout_s sim seconds pass; the next step starts in that same tick. A step without until ends as soon as its actions apply.

Every step is checked (mode names, channels, PWM, values, speedup range) before anything runs, and one bad step rejects the program. Arm with the arm tool first; a program cannot arm or upload a mission. One program per session at a time.

Returns within about 85 s: status done, failed or aborted with every step's result (reason, start and end sim time, a snapshot taken in its settling tick), or status running with the steps settled so far and the current index, followed with steps_status. On an idle-paced session a running program keeps the sim at full speed, waited on or not, and idle applies once it ends.

Hover hop, after arm(mode="QLOITER"): [{rc: {3: 2000}, until: "altitude", value: 5}, {rc: {3: 1500}, until: "sim_time", value: 15, relative: true}, {mode: "QLAND", until: "disarmed", timeout_s: 120}].

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
stepslist[StepModel]requiredthe steps, run in order with no delay between them

Returns StepsResult

steps_statusread-only

The session's latest step program: its status, the current step, and the results so far. Follow a program longer than one fly_steps call with this.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
waitboolTruewait up to about 85 s for the program to end; false answers at once

Returns StepsResult

abort_steps

Stop the running step program after the current tick. RC stays as last set, so set the throttle (rc_override) or a mode next. A finished program is returned unchanged.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl

Returns StepsResult

fly_exact

Fly a mission or a step program that repeats bit for bit: the same recipe gives the same log, every IMU sample and estimator state, at any speedup and under any load. Needs a session opened with exact=true, disarmed. The flight waits, disarmed, for sim second at_s, arms itself there and flies items (a mission) or steps (a program SITL runs on the physics step, followed with steps_status); nothing from outside steers it after this call (the steering tools refuse; snapshot, wait_until, set_speedup, disarm, abort_steps and close_sitl still work). Returns once it has armed at the anchor, or with armed false and the autopilot's refusal. anchor_utc is the anchor on SITL's own clock, which an exact session pins to a fixed date (exact.START_TIME), so it reads as 2026-09-21, not today. Then wait_until disarmed (or steps_status), and close_sitl: the kept log and its recipe replay exactly with repro.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
itemslist[MissionItem] | NoneNonea mission flight, as upload_mission takes it: e.g. NAV_VTOL_TAKEOFF, NAV_WAYPOINT, NAV_LOITER_TIME, NAV_VTOL_LAND. Give items or steps
stepslist[StepModel] | NoneNonea step program, as fly_steps takes it (rc, mode, params, wind, speedup; until altitude, airspeed, mode, armed, disarmed, time or sim_time), run inside SITL on the physics step after arming in arm_mode: stick-driven flights and mid-flight parameter changes repeat too. Needs a SITL built with sitl-patches/sitl-program.patch
arm_modestr"QLOITER"steps only: the mode the program arms in at the anchor
at_sint | NoneNonethe sim second the flight starts at, counted from the boot that flies it: with reboot, the second boot (default 45, at least 30); without, this one (default 15 s from now). repro passes the original's, so a replay starts on the same tick
rebootboolTruestore the mission and boot SITL again on it, in AUTO from its first tick, so nothing on the pad happens at a wall-clock moment and wind on the pad repeats (about 10 s of wall time). false flies it in the running SITL, as flights before 2026-10-08 did and their repros still do; that repeats only while the pad is calm

Returns dict

Mean wind and gusts, applied on sim time. The fields are on Step, wind and mission fields.

set_wind

Set the session's wind: a mean speed and direction, an optional updraft, and gusts. Dryden gusts are computed by the server every 0.05 sim s from the current height and airspeed and sent to SITL as SIM_WIND_*, so they evolve through every wait. {speed_mps: 0} stops the wind. A step program's wind action does the same mid-program.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
windWindModelrequiredA mean wind and its gusts, applied by the server on sim time.

Returns Snapshot

wind_historyread-only

The gusts the session flew: rows of sim time, the gust along the mean wind (u), across it (v) and up (w), and the SIM_WIND_* values SITL was given.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
secondsfloat30how far back, up to 120 sim s
step_sfloat0.5one row per this many sim seconds

Returns dict

Replay a kept flight from its recipe, or fly a batch of A/B pairs and compare them. How a replay is judged the same flight, and what an exact batch adds, are in Fly an exact mission.

repro

Fly a kept log again from its recipe (<stem>.recipe.json, written at close for every open_sitl session): the same open arguments, then every acting call in order (arm, rc_override, set_mode, set_param, set_wind, waits, step programs, disarm), through the same tools. Each wait and program runs to its end before the next call, so a slower machine replays the flight, not the clock; abort_steps is skipped, its timing having been the agent's. Then the new log is compared with the original (log_compare's result under compare).

It is the same recipe, not the same bytes: commands land in whatever sim tick they reach, so read compare's percentages, not equality. The exception is a flight flown with fly_exact, which repeats: identical then checks the two logs record by record from the anchor and names the first difference. binary_matches says whether the binary is the one that flew. Pass binary or tree to fly a new build against the old flight, which is the question "did my change break this?".

A background job: waits up to about 85 s, then repro_status follows it.

ParameterTypeDefaultMeaning
logstrrequireda kept log's name (list_logs) or path; it needs its recipe
binarystr | NoneNonefly another SITL binary instead (a new build to test against the old)
treestr | NoneNoneor the binary built in this ArduPilot tree
labelstr | NoneNonethe new flight's label

Returns dict

repro_statusread-only

A repro's state (opening, replaying, closing, comparing, done or failed), the calls replayed so far and any skipped, the new session and log, whether the binary matched the recipe's, and, once done, the comparison with the original: briefly (totals, parameters that really changed, flying phases' headline numbers, texts that differ), with the whole of it saved as JSON at compare_full; detail puts it inline.

ParameterTypeDefaultMeaning
repro_idstrrequiredfrom repro
waitboolTruewait up to about 85 s for it to finish
detailboolFalsethe whole comparison inline, every phase and metric

Returns dict

batch_compareread-only

Set B of flights against set A, for a question one pair cannot answer: is a gap real, or the spread SITL flights have anyway? Every log_summary phase (matched across logs by mode, armed, flying, mission item and occurrence) and the totals are compared: per metric both distributions (n, mean, sd, min, max), the gap of the means and its percent, d (the gap in pooled standard deviations), Welch's t-test p, and q, that p adjusted for the number of tests (Benjamini-Hochberg); shown lists what clears q < 0.05. Your measures and outcomes are adjusted as one family (the question you asked), the phase metrics as another (exploration), so a stated hypothesis is not diluted by dozens of numbers you did not ask about. Measures add numbers of your own, and yes/no outcomes come with both rates and Fisher's exact p. per_log gives each log's measures, to see which flight did what.

Works on any dataflash logs, a test harness's included. A background job: waits up to about 85 s, then batch_status follows it.

ParameterTypeDefaultMeaning
alist[str]requiredset A: kept log names, session ids or paths
blist[str]requiredset B, the same way
measureslist[MeasureModel] | NoneNoneextra numbers or yes/no outcomes per flight, beyond the phases and totals compared anyway: a log field reduced over a window, a phase metric, or an autopilot text

Returns dict

batch_fly

Fly a kept log's recipe n times on side A and n times on side B, interleaved (A B, then B A, round by round) so drift in machine load falls on both alike, then compare the sets as batch_compare does. Each flight is a repro through the same tools; one that fails is recorded (status, error, its log) and counts toward the flight_failed outcome rather than ending the batch.

A side can differ by binary (binary or tree) or by parameters (set_a, set_b, laid over the recipe's own), or both: "does Q_A_RAT_RLL_P 0.4 beat 0.25?" is one call. With nothing given for B it flies A's binary on both sides: a null control, whose gaps are the run-to-run noise any real comparison has to beat. Two builds that should behave the same (a compiler-only change, an in-tree binary against its container build) are the same control with a reason. A flight that crosses a hard threshold shows up here as an outcome rate, not as one replay that flipped.

A recipe flown with fly_exact repeats bit for bit, so its batch ignores n and flies three flights: A, A, B (the job's note says so and its n is null). A against A must be identical record for record, which proves there is no noise to see past; then every difference between A and B is the change, reported as plain differences rather than statistics: where B first departs from A (b_departs, often a rounding far too small to see), where it first departs visibly (b_visible: SITL's position more than 1 mm or attitude more than 0.1 degrees off), and the largest change in a flying phase. The first A flight is also checked against the original log (a_matches_original). If A does not repeat, the result says so.

With film, the batch also renders side A's first flight with side B's as a ghost beside it: for an exact recipe, a film of where the change first acts.

Long: n of 5 is ten flights. Waits up to about 85 s, then batch_status follows.

ParameterTypeDefaultMeaning
logstrrequireda kept log whose recipe to fly (as repro takes)
nint5flights per side, 2 to 50; an exact recipe (flown with fly_exact) ignores it and flies A, A, B
binary_astr | NoneNoneside A's SITL binary; default the recipe's
tree_astr | NoneNoneor the binary built in this tree
binary_bstr | NoneNoneside B's SITL binary; default the same as A (a null control)
tree_bstr | NoneNoneor the binary built in this tree
set_adict[str, float] | NoneNoneparameters over the recipe's on side A, e.g. {"Q_A_RAT_RLL_P": 0.25}
set_bdict[str, float] | NoneNoneparameters over the recipe's on side B: the change under test
measureslist[MeasureModel] | NoneNoneextra numbers or yes/no outcomes per flight, beyond the phases and totals compared anyway: a log field reduced over a window, a phase metric, or an autopilot text
film"chase" | "ground" | "fpv" | NoneNonealso film the answer: side A's first flight with side B's flown as a ghost beside it (render_film ghost), from this camera. For an exact recipe the split is exact and starts where the change first acts; video_status follows the film (its video_id is under film)

Returns dict

batch_statusread-only

A batch's state (queued, flying, comparing, done or failed), every flight so far with its side, status and log, and once done the comparison: by default a summary (what is shown, each flying phase's headline numbers as [mean, sd, n] a side, totals, measures, outcomes) with the whole comparison saved as JSON at full; detail puts it inline.

ParameterTypeDefaultMeaning
batch_idstrrequiredfrom batch_compare or batch_fly
waitboolTruewait up to about 85 s for it to finish
detailboolFalsethe whole comparison inline (every metric, each log's measures)

Returns dict

Watch a session live, render a log as a quick HUD video or a lit 3D film, and look at a frame yourself. The film options, ghosts, music and fast-forward among them, are in Watch a flight.

video_feed

Start (or restyle, or stop) a live video feed of a session for a person to watch: VLC opens the "vlc" URL, a browser the "page" URL. The picture is SITL's own simulated pose with a HUD of the session's state. While anyone watches, the session runs no faster than real time, so they see the flight as it would look; idle pacing still holds the sim between your calls, shown as HOLDING. Snapshots report the viewer count.

ParameterTypeDefaultMeaning
session_idstrrequiredfrom open_sitl
onboolTruefalse stops the feed
layout"fpv" | "chase" | "pip" | NoneNonefpv: nose camera with a HUD; chase: from behind; pip: fpv with the chase inset

Returns dict

render_video

Render a flight's dataflash log to an MP4 beside it (<log stem>.<layout>.mp4), as a background job. The pose is SITL's own truth from the log (SIM, SIM2) and the wind the one SITL flew (its SIM_WIND parameters), and log time is sim time, so the video plays at the speed the aircraft flew whatever speedup the session ran at. Waits up to about 85 s; a longer render keeps going and video_status follows it. Rendering runs faster than real time.

ParameterTypeDefaultMeaning
logstrrequireda session id, a kept log's name, or a path, as log_summary
layout"fpv" | "chase" | "pip""pip"fpv: nose camera with a HUD; chase: from behind; pip: fpv with the chase inset
t0_sfloat | NoneNonestart, log seconds; default 4 s before arming
t1_sfloat | NoneNoneend, log seconds; default 4 s after disarming

Returns dict

render_film

Render a flight's log as a lit 3D film in Blender: sky, sun and shadows, a runway along the home heading, the airframe from MCARDUPILOT_FILM_MESH (a simple quadplane when unset), and the wind SITL flew, gusts included: a windsock that stands out at 15 knots and swings with each gust, and gust patches drifting across the grass at the wind's speed. An MP4 beside the log, <log stem>.film-<camera>.mp4, as a background job that video_status follows. The pose is SITL's own truth from the log, at the speed the aircraft flew. For a person to watch; render_video is the quick one with a HUD and video_frame the one for you to look at. Slower than render_video: with eevee about 0.1 to 0.3 s a frame, so a minute of flight takes a few minutes. Waits up to about 85 s.

ParameterTypeDefaultMeaning
logstrrequireda session id, a kept log's name, or a path, as log_summary
camera"chase" | "ground" | "fpv""chase"chase: behind and above, turning with the aircraft; ground: a fixed spot beside the takeoff point, following it like a spectator; fpv: a nose camera looking ahead, rolling and pitching with the aircraft
engine"eevee" | "cycles" | NoneNoneeevee is quick; cycles is path traced and many times slower. Default from MCARDUPILOT_FILM_ENGINE
t0_sfloat | NoneNonestart, log seconds; default 4 s before arming
t1_sfloat | NoneNoneend, log seconds; default 4 s after disarming
airframestr | NoneNonean airframe description (JSON) to draw it with; default the one the log's recipe names (from its preset), else MCARDUPILOT_FILM_AIRFRAME
hudboolTruethe flight's numbers over the film: altitude and climb, speeds, attitude and heading, mode, lift and thrust, battery, wind, messages
introboolTrueopen on an establishing shot: the camera eases round the aircraft on the ground under a title card (the flight, what flew, when and where, the wind), then runs into the flight
units"aviation" | "imperial" | "metric" | NoneNonethe HUD's heights and speeds: aviation (ft, knots, ft/min), imperial (ft, mph, ft/min) or metric (m, m/s); default MCARDUPILOT_FILM_UNITS, aviation unless set
mapboolTruewith the HUD, a north-up map inset: the whole ground track faint, the part flown so far in amber, home, and the aircraft along its heading
ghoststr | NoneNoneanother flight's log (a session id, a kept log's name, or a path, as log) to fly beside this one as a translucent ghost of the same airframe, each from its own takeoff point. The two are aligned by log time, so for an exact A/B (batch_fly on a recipe flown with fly_exact) they fly as one until the change takes hold and then visibly split; the HUD names the ghost, gives the separation, maps both tracks and marks where they part. Other pairs are aligned by log time too, which only lines them up if they started together. Writes <log stem>.film-<camera>-ghost.mp4
titlestr | NoneNonewhat the title card and the HUD call the flight, e.g. the question it answers; default its log's name
ghost_titlestr | NoneNonewhat they call the ghost; default its log's name
placeboolTruethe title card's coordinates of where it flew; false leaves them off (SITL's home is often a stand-in, and a place line reads as if the aircraft flew there)
musicstr | NoneNonea sound file to lay under the film (any format ffmpeg reads), looped if shorter and faded in and out; use a recording you may publish, such as a public-domain one (the composition being old is not enough: each recording has its own rights)
music_creditstr | NoneNonethe music's credit for the title card, e.g. 'Wagner, Ride of the Valkyries (American Symphony Orchestra, Edison 1921, public domain)'; default the file's name
music_volumefloat0.7the music's level, 0 (exclusive) to 2; 1 is as recorded
music_start_sfloat0where in the track to start, seconds
airspeed"true" | "eas" | "sensor""true"the HUD's airspeed: true (SITL's true airspeed, the default); eas (the airspeed sensor's reading as logged, ARSP, labelled EAS as ArduPilot names it); or sensor (the same reading labelled IAS, with the pitot's EAS before a modelled static-port error beside it as EAS where the log has SACP, so the side-port error shows on screen)
namestr | NoneNonea suffix for the file, <stem>.film-<camera>-<name>.mp4, so a test or a variant lands beside a film rather than on it: lower-case letters, digits and dashes
overwriteboolFalsereplace a film that already has this file name; without it an existing film is refused, so a quick render cannot replace a finished one
outroboolTrueend on a card: the last frame held under the flight's name, its numbers (time aloft, highest point, distance flown) and the credits, then down to black (MCARDUPILOT_FILM_OUTRO_S, 5 s)
stingbool | NoneNonethe film's own opening and closing sounds, synthesized from its airframe (each rotor a voice spinning up into a chord, a chime on the title, then spinning down over the end card), with the music between them. Default: with music, yes; without, no. true on a silent film writes -sting.mp4
sting_keystr | NoneNonethe stings' key, so the opening leads into the music: a note and m for minor, e.g. 'E', 'Db', 'F#', 'Bm'. Default: the music's own, found from the minute of it the film plays (from music_start_s); A major without music
flight_soundbool | NoneNonethe flight's own sound under it: each rotor a voice at its logged output, the air at the logged airspeed and gusts, a click at arming, a note at each mode change, a thump at touchdown as hard as it was; with a ghost, its rotors fall out of tune with the main ones as the two part. Default: with the stings. Without music or stings it writes -sound.mp4
fast_forwardlist[FastForward] | NoneNonestretches of the flight to play faster, in log seconds, e.g. [{from_s: 190, to_s: 300, speed: 4}] for two minutes of circling in 28 s. The HUD shows the speed while it lasts and its clock keeps log time; writes <stem>.film-<camera>-ff.mp4

Returns dict

video_statusread-only

A render's state (queued, rendering, done, failed or cancelled), its progress in frames, and the MP4's path once done.

ParameterTypeDefaultMeaning
video_idstrrequiredfrom render_video, render_film or close_sitl
waitboolTruewait up to about 85 s for it to finish

Returns dict

video_frameread-only

One rendered frame as an image, to look at what a person watching would see: a live session's picture now (from its live feed when one runs, so exactly what is on their screen), or a log's at t_s.

ParameterTypeDefaultMeaning
session_idstr | NoneNonea live session: the picture now
logstr | NoneNoneor a log (as log_summary): the picture at t_s
t_sfloat | NoneNonelog seconds, with log
layout"fpv" | "chase" | "pip""pip"fpv: nose camera with a HUD; chase: from behind; pip: fpv with the chase inset

Returns Image

Compile a SITL binary with waf as a background job, and follow it. Which trees may be built, and the Python waf runs under, are in Build a SITL binary.

build_sitldestructive

Build a SITL binary with ArduPilot's waf, as a background job: ./waf configure --board sitl when needed, then ./waf plane (or another vehicle). Waits up to about 85 s and returns the job's state; a longer build keeps going, so follow it with build_status. A first build takes minutes, an incremental one about half a minute. Only trees named in MCARDUPILOT_BUILD_TREES are built, plus the default tree while its git checkout is clean, so a patched tree other runs depend on is never rebuilt by accident. On success the result carries the binary's path and provenance (tree SHA, patch hash, build time).

Container mode (give image and commit) builds explicit inputs instead: a fresh checkout of commit from tree (submodules from the tree's own, offline), patches applied in order, built in the image with no network. The output goes to <data_dir>/builds/<build_id>/ in tree layout with manifest.json; open_sitl's tree argument flies it. build_id is a hash of the inputs, so the same inputs answer from the finished build at once (cached: true).

ParameterTypeDefaultMeaning
treestr | NoneNoneArduPilot tree; default the server's ardupilot tree
vehicle"plane" | "copter" | "heli" | "rover" | "sub" | "antennatracker" | "blimp""plane"waf target
boardstr"sitl"waf board
configurebool | NoneNonerun ./waf configure first; default only when the tree is not configured for this board
configure_argslist[str] | NoneNoneextra configure flags, e.g. ["--debug"] or ["--no-submodule-update"]; given, configure runs
imagestr | NoneNonecontainer mode: the build image by digest, name@sha256:...; tree is then the source repository, only read
commitstr | NoneNonecontainer mode: the commit to build (a SHA)
patcheslist[str] | NoneNonecontainer mode: patch files applied in order after the checkout
reproduceboolFalsecontainer mode: build a second time from a fresh checkout and record whether the binary came out byte for byte the same

Returns dict

build_statusread-only

A build's state (queued, staging, configuring, building, verifying, done, failed or cancelled) with waf's step count and progress, the binary and its provenance once done, and on failure the error and the last log lines.

ParameterTypeDefaultMeaning
build_idstrrequiredfrom build_sitl
waitboolTruewait up to about 85 s for it to finish
tailint0last log lines to include

Returns dict

cancel_builddestructive

Stop a running build (its whole process group). The tree is left as waf left it; the next build carries on from there.

ParameterTypeDefaultMeaning
build_idstrrequiredfrom build_sitl

Returns dict

list_buildsread-only

The builds this server process started since it came up, newest last, as build_status reports them, then every container build on disk from earlier runs (on_disk true), read from its manifest: its binary, commit, image, patch hashes and whether it reproduced. open_sitl's tree flies any of them.

Returns list[dict]

A log is named by a session id (its live log, while the session is open), a kept log’s name from list_logs, or a path to a .BIN. Over the HTTP transport, only paths under the server’s data directory are read.

list_logsread-only

Dataflash logs this server keeps (close_sitl moves them here), newest first, and the live log of each open session. A kept log says whether it has a recipe (repro can fly it again) and lists the videos rendered from it.

ParameterTypeDefaultMeaning
limitint50newest first

Returns list[dict]

log_summaryread-only

A flight by phase, cut at every flight-mode change, arm and disarm, takeoff and touchdown (ArduPlane's own flying detector, STAT.isFlying), and in AUTO every mission item. Each phase has its mode, armed and flying flags, duration, energy in Wh, and averages of airspeed, groundspeed, throttle, lift motors, pitch, angle of attack, current and voltage, with peak roll, current and height. So a hover's averages are the hover's alone, not diluted by idle time on the ground before the climb. Plus the firmware, every autopilot text with its time, and message counts. Times are seconds since boot, as in the log.

ParameterTypeDefaultMeaning
logstrrequireda session id (its current log), a kept log's name from list_logs, with or without .BIN, or a path to a .BIN

Returns dict

log_fieldsread-only

A time series from the log: rows of [t_s, *fields] with each column's unit. An unknown message or column is answered with the ones the log does have.

ParameterTypeDefaultMeaning
logstrrequireda session id (its current log), a kept log's name from list_logs, with or without .BIN, or a path to a .BIN
msgstrrequiredmessage type, e.g. ATT, ARSP, BAT, CTUN, XKF1
fieldslist[str]requiredcolumns to return, e.g. [Roll, Pitch]
t0float | NoneNonefrom, seconds since boot
t1float | NoneNoneto, seconds since boot
stepfloat | NoneNoneone row per this many seconds
instanceint | NoneNonesensor or core instance, for types that have one
max_rowsint2000at most 5000; the step widens to fit

Returns dict

log_messagesread-only

Whole log messages of the given types in time order, every field included; "more" says the limit cut the list short.

ParameterTypeDefaultMeaning
logstrrequireda session id (its current log), a kept log's name from list_logs, with or without .BIN, or a path to a .BIN
typeslist[str]requirede.g. [MSG, MODE, ERR, EV, CMD]
t0float | NoneNonefrom, seconds since boot
t1float | NoneNoneto, seconds since boot
limitint200at most 1000

Returns dict

log_compareread-only

Flight B against flight A, for an A/B test (the same flight with a parameter or model file changed). Every number is {a, b, delta, pct}: delta is b - a, pct is delta as a percent of |a|, null when a is 0 or missing.

phases: each flight's log_summary phases are keyed by (mode, armed, mission_item) and matched in order, by longest common subsequence: a phase only one flight has is listed under only_in_a or only_in_b with its index, and every later pair still lines up. matched holds each pair's indexes, times and metrics (duration_s, energy_wh, airspeed, throttle, lift, current, peak height and the rest). totals: whole-log duration, energy in Wh (BAT volts times amps, integrated), peak height and peak current. params: changed {name: {a, b}}, only_in_a and only_in_b {name: value}, and how many are the same; often the whole point of the comparison, so check it first. Values ArduPilot rewrites itself every flight (STAT_*, *_GND_PRESS) are kept apart under bookkeeping. texts: autopilot messages one flight printed and the other did not, ignoring times, the firmware banner and the build hash line; messages that differ only in their numbers ("Reached waypoint #2 dist 91m" against 77m) are grouped under numbers_differ by a template with {n} for each number. same_firmware compares the banners, which carry the build's git hash.

ParameterTypeDefaultMeaning
astrrequireda session id (its current log), a kept log's name from list_logs, with or without .BIN, or a path to a .BIN
bstrrequireda session id (its current log), a kept log's name from list_logs, with or without .BIN, or a path to a .BIN
paramsboolTruealso diff the parameters (PARM, last value per name)

Returns dict

pin_log

Spare a kept log from pruning, or let pruning take it again. Kept logs past log_budget_gb (server_info) are deleted oldest first whenever a close keeps one.

ParameterTypeDefaultMeaning
logstrrequireda kept log's name from list_logs, or a path inside logs_dir
pinnedboolTrueFalse unpins

Returns dict

Leases for SITLs you launch yourself, and the view of who holds what.

lease_instance

Reserve a SITL instance for something you launch yourself (a script, sim_vehicle.py -I <n>). The instance's lock is held by this server until release_instance or the server exits, and other sessions and scripts skip it. open_sitl leases its own instance; sessions do not need this.

ParameterTypeDefaultMeaning
ownerstrrequiredwho holds it, shown to every other caller
instanceint | NoneNonea pool instance to ask for; omit for the first free

Returns dict

release_instance

Give back an instance taken with lease_instance. Sessions release theirs at close_sitl.

ParameterTypeDefaultMeaning
instanceintrequiredthe instance lease_instance returned

Returns dict

kill_instancedestructive

Stop whatever SITL runs on an instance. This server's own session there is closed (its logs kept per its keep_logs). A SITL that no lease covers (a stray from a crashed script, autotest.py, make fly) is killed if the process on its ports is a SITL binary. An instance leased by someone else is refused, with the holder named: only its holder may stop it.

ParameterTypeDefaultMeaning
instanceintrequiredthe instance number (list_instances shows who is on it)
forceboolFalsealso act outside the pool or on a reserved instance (0 is autotest.py's); scripts that take no leases may be using those

Returns dict

list_instancesread-only

Every instance that is leased (by any process, in or out of the pool) or has its ports taken without a lease, with the holder, this server's session on it, and the process on each taken port.

ParameterTypeDefaultMeaning
all_poolboolFalselist free pool instances too, not only busy ones

Returns list[InstanceInfo]

server_inforead-only

Server version, the ArduPilot tree and SITL binary (with its build time), the instance pool and who holds each leased instance, and the server's limits.

Returns ServerInfo

The result types the tools above return that have no page of their own. Snapshot is on Snapshot fields, WaitResult on Wait conditions and reasons, and the step results on Step, wind and mission fields.

FieldTypeMeaning
session_idstr
instanceint
mavlink_portintMAVLink TCP; this server owns the link
pidint
run_dirstr
defaultslist[str]parameter files SITL loaded, in order
lua_loadedlist[str]
provenancedictbinary, its build time, tree SHA and patch hash
snapshotSnapshot
warningslist[str]things that did not stop the session but will matter later, such as a preset's airframe that does not load (films then draw the stand-in)
FieldTypeMeaning
armedbool
refusedstr | Nonethe autopilot's last PreArm or Arm text
snapshotSnapshot
FieldTypeMeaning
session_idstr
instanceint | None
keptlist[str]dataflash logs kept, at their new paths
prunedlist[str]older kept logs deleted to stay under log_budget_gb (pin_log spares one)
statestr
videodict | Nonethe render record_video started; video_status follows it to its MP4
FieldTypeMeaning
session_idstr
labelstr | None
statestr
instanceint | None
pidint | None
run_dirstr | None
speedupfloat
idle_speedupfloat | None
keep_logsstr
opened_atstr
idle_sfloat
FieldTypeMeaning
instanceint
in_poolbool
mavlink_portint
holderstr | Nonelease holder, any process
session_idstr | Nonethis server's session on the instance
leased_hereboolheld through lease_instance by this server
busy_portslist[str]ports taken, with the process holding each
FieldTypeMeaning
versionstr
ardupilotstrArduPilot tree the SITL binary comes from
binarystrSITL binary sessions launch
binary_existsbool
binary_mtimestr | NoneUTC build time of the binary; a change mid-flight means a rebuild
instance_poolstrinstances this server leases; instance n uses MAVLink TCP 5760 + 10n and SITL's JSON backend 9002 + 10n
leases_helddict[str, str]instance -> holder for every held instance, from any process, including leases taken outside the pool
leases_dirstr
sessions_openint
reconciledlist[str]SITLs a dead server left, killed at start
data_dirstr
transportstr
wait_cap_sfloatlongest any waiting tool blocks before returning
session_idle_sfloat
log_budget_gbfloatkept logs past this are pruned, oldest first
logs_used_gbfloatsize of the kept logs now