Step, wind and mission fields
These are the objects some tools take as arguments. Unknown fields are refused, so a typo fails at once rather than being ignored. All of them are read from the pydantic models in mcardupilot.models.
StepModel
Section titled “StepModel”One step of a fly_steps program: instant actions applied in the tick the step starts, then one wait. The next step starts in the tick this one settles.
| Field | Type | Default | Meaning |
|---|---|---|---|
label | str | None | None | a name for the step in the results |
rc | dict[int, int] | None | None | RC override to set as the step starts, channel (1 to 8) to PWM (800 to 2200), e.g. {3: 2000}; held until a later step or call changes it |
mode | str | None | None | flight mode to request as the step starts, sent once and not confirmed: wait on until mode to verify it |
speedup | float | None | None | SIM_SPEEDUP to set as the step starts, 0.05 to 50 |
params | dict[str, float] | None | None | parameters to set as the step starts, fire and forget |
wind | WindModel | None | None | wind to set as the step starts (a gust front, a calm) |
until | "altitude" | "airspeed" | "mode" | "armed" | "disarmed" | "text" | "waypoint" | "time" | "sim_time" | "landed" | None | None | the condition that ends the step, as in wait_until; omit it and the step ends in the tick its actions apply |
value | float | str | None | None | the number, mode name or text the condition waits for |
op | ">=" | "<=" | "==" | ">=" | comparison for numeric conditions |
timeout_s | float | None | None | sim seconds from the step's start before reason timeout (at most 3600); default 60, or the wait plus 60 for time and relative sim_time |
relative | bool | False | sim_time only: value is seconds after the tick this step started, which is the tick the previous step settled |
on_timeout | "stop" | "continue" | "stop" | on timeout, stop the program (failed) or go on |
Rules the server checks before anything runs, so one bad step rejects the whole program and names its index:
- A program has 1 to 100 steps. A step’s
timeout_sis at most 3600 sim seconds. - Channels are 1 to 8 and PWM 800 to 2200.
speedupis 0.05 to 50. - Mode names, in
modeand inuntil: "mode", are checked against the vehicle’s mode table, so a typo fails instead of waiting out its timeout. - Numeric conditions (
altitude,airspeed,waypoint,time,sim_time) need avalue;modeandtextneed a non-empty one. relativeapplies tosim_timeonly. Fortimeand relativesim_time, the default timeout is the wait plus 60 s, and a timeout shorter than the wait is refused.
StepResult
Section titled “StepResult”One settled step, as fly_steps, steps_status and abort_steps return it.
| Field | Type | Meaning |
|---|---|---|
index | int | the step's position in the program, from 0 |
label | str | None | |
reason | str | met; timeout; died (SITL died, see snapshot.error); aborted (abort_steps, close_sitl, or an internal error named in the program's error) |
t_start_s | float | None | sim time the step's actions applied; None if it never started |
t_end_s | float | sim time the step settled |
snapshot | Snapshot | taken in the tick the step settled |
StepsResult
Section titled “StepsResult”| Field | Type | Meaning |
|---|---|---|
status | "running" | "done" | "failed" | "aborted" | running (follow it with steps_status); done (every step settled, timeouts with on_timeout continue included); failed (a step timed out with on_timeout stop, or SITL died); aborted (abort_steps or close_sitl) |
current | int | None | index of the running step; None when finished |
steps | list[StepResult] | results of the steps settled so far |
error | str | None | why the program failed, if it did |
WindModel
Section titled “WindModel”The wind for set_wind, open_sitl(wind=...) and a step’s wind action. Ranges the server enforces: speed_mps 0 to 60, up_mps -20 to 20, scale above 0 and at most 5. {"speed_mps": 0} stops the wind.
| Field | Type | Default | Meaning |
|---|---|---|---|
speed_mps | float | 0 | mean horizontal wind, 0 to 60 m/s |
from_deg | float | 0 | the direction it blows from, degrees |
up_mps | float | 0 | mean vertical wind, up positive |
gusts | "off" | "dryden" | "sitl" | "off" | off: steady; dryden: MIL-F-8785C gusts from height and airspeed, sigma_w 0.1 x the mean wind; sitl: SITL's own SIM_WIND_TURB (near-white noise) |
scale | float | 1 | multiplies the gust strength, up to 5 |
seed | int | None | None | repeat the same gusts in another flight (same sim ticks) |
method | "exact" | "euler" | "exact" | the Dryden update; euler reproduces runs made before the exact update |
With gusts: "sitl" the server sets SITL’s own SIM_WIND_TURB to 0.1 × speed_mps × scale. With dryden it sets SIM_WIND_TURB to 0 and sends the sum of mean wind and gust as SIM_WIND_SPD, SIM_WIND_DIR and SIM_WIND_DIR_Z. How the gusts are made.
MissionItem
Section titled “MissionItem”One item for upload_mission, positioned in metres from home. Home goes in as item 0, so items[i] becomes mission item i + 1. Navigation commands get a position; DO_ commands ignore north_m and east_m.
| Field | Type | Default | Meaning |
|---|---|---|---|
cmd | int | str | required | MAV_CMD number or name: "NAV_WAYPOINT", "NAV_VTOL_TAKEOFF", "NAV_VTOL_LAND", "NAV_LOITER_TIME", "DO_CHANGE_SPEED", ... ("MAV_CMD_" optional) |
north_m | float | 0 | |
east_m | float | 0 | |
alt_m | float | 0 | above home |
params | list[float] | [] | param1 to param4 |
tag | str | "" |
upload_mission(session_id, items=[ {"cmd": "NAV_VTOL_TAKEOFF", "alt_m": 40, "tag": "takeoff"}, {"cmd": "NAV_WAYPOINT", "north_m": 400, "alt_m": 60}, {"cmd": "NAV_WAYPOINT", "north_m": 400, "east_m": 400, "alt_m": 60}, {"cmd": "NAV_VTOL_LAND", "tag": "land"},])