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.
Session
Step
Repro
Video
Wind
Build
Log
Lease
Info
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.
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.
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.
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.
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).
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.
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.
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.
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).
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.
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.
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.
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}].
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
Returns dict
release_instance
Give back an instance taken with lease_instance. Sessions release theirs at close_sitl.
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.
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.
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.