Snapshot fields
A snapshot is one look at a session, built from the latest MAVLink message of each type the pump thread has received. snapshot returns one on demand. wait_until, arm, set_mode, disarm, set_speedup, set_wind and every step result carry one too.
The session asks SITL for these streams on top of the defaults: HEARTBEAT at 4 Hz, ATTITUDE, VFR_HUD and SERVO_OUTPUT_RAW at 10 Hz, SYS_STATUS, BATTERY_STATUS, MISSION_CURRENT and EXTENDED_SYS_STATE at 2 Hz, and SITL’s own truth (SIMSTATE, SIM_STATE) with SYSTEM_TIME at 20 Hz. A field whose message has not arrived yet is null.
Snapshot
Section titled “Snapshot”| Field | Type | Meaning |
|---|---|---|
session_id | str | |
state | str | starting, open, died or closed |
seq | int | messages received so far; pass as since_seq to wait_until |
t_sim_s | float | autopilot time since boot, s |
speedup | float | the speed SITL is running at now |
viewers | int | people watching the live video feed; while any do, the session runs no faster than real time (idle pacing still applies) |
instance | int | None | |
armed | bool | |
mode | str | None | |
mode_since_s | float | None | sim time the autopilot's reported mode last changed to this one |
height_m | float | above the pad since arm, else above home |
lat | float | None | |
lon | float | None | |
roll_deg | float | None | |
pitch_deg | float | None | |
yaw_deg | float | None | |
airspeed_mps | float | None | |
groundspeed_mps | float | None | |
climb_mps | float | None | |
throttle_pct | float | None | |
volts | float | None | |
amps | float | None | |
mah | float | None | consumed charge since the last battery reset |
landed | bool | None | from EXTENDED_SYS_STATE; None until it arrives, and None after a disarm until a report newer than the disarm says (it comes at 2 Hz of sim time) |
mission_seq | int | None | current mission item (MISSION_CURRENT) |
rc | list[int] | RC override this server sends, channels 1 to 8; empty when it sends none (an exact session, whose program's sticks are applied inside SITL) |
servo | list[int] | None | SERVO_OUTPUT_RAW channels 1 to 8 |
texts | list[Text] | latest STATUSTEXTs, oldest first |
wind | dict | None | the session's wind: mean, gusts, the gust now and what SITL got |
error | str | None | why the session died, if it did |
seq counts every message the session has received. It only grows, which is what makes it useful as since_seq.
height_m comes from SITL’s true position (SIM_STATE), measured from the pad, once the session has armed; before the first arm it is the autopilot’s own height above home. rc is what this server sends as RC override, not what the autopilot’s mixer chose; servo is the autopilot’s output.
landed is ArduPilot’s own landed state from EXTENDED_SYS_STATE. After a VTOL landing, ArduPlane can disarm while its last report still says in the air: its flying estimate decays over about three seconds, and the next report comes up to half a sim second later. Idle pacing holds the sim at 0.05 between calls, which stretches that half second to ten seconds of wall time. So for a disarmed vehicle whose latest report predates the disarm and says in the air, landed is null (not known yet) rather than false. wait_until with landed runs the sim at full speed and ends once the next report says so.
wind, when the session has one, holds the mean wind, the gust settings, profile (uniform or sitl, how the wind changes with height), gust_mps (the gust now, along, across and up) and sitl (the SIM_WIND_SPD, SIM_WIND_DIR and SIM_WIND_DIR_Z SITL was last given).
A snapshot from a hover on the stock quadplane, with texts=1. volts reads 0 because the stock parameters configure no battery monitor.
{ "session_id": "d79353", "state": "open", "seq": 8767, "t_sim_s": 67.961, "speedup": 0.05, "instance": 40, "armed": true, "mode": "QLOITER", "mode_since_s": 10.264, "height_m": 7.37, "lat": -35.3632629, "lon": 149.1652371, "roll_deg": 0.11, "pitch_deg": -0.19, "yaw_deg": 355.45, "airspeed_mps": 0.92, "groundspeed_mps": 0.022, "climb_mps": -0.008, "throttle_pct": 59.0, "volts": 0.0, "amps": null, "mah": null, "landed": false, "mission_seq": 0, "rc": [1500, 1500, 1500, 1500, 1800, 1500, 1500, 1500], "servo": [1500, 1500, 1000, 1500, 1750, 1750, 1750, 1750], "texts": [ { "seq": 6329, "t_sim_s": 49.563, "text": "Throttle armed" } ], "wind": null, "error": null}One autopilot STATUSTEXT, with the seq it arrived at. The session keeps the latest 200.
| Field | Type | Meaning |
|---|---|---|
seq | int | |
t_sim_s | float | |
text | str | |
repeated | int | earlier identical texts folded into this one (pre-arm retries) |