Skip to content

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.

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.

FieldTypeDefaultMeaning
labelstr | NoneNonea name for the step in the results
rcdict[int, int] | NoneNoneRC 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
modestr | NoneNoneflight mode to request as the step starts, sent once and not confirmed: wait on until mode to verify it
speedupfloat | NoneNoneSIM_SPEEDUP to set as the step starts, 0.05 to 50
paramsdict[str, float] | NoneNoneparameters to set as the step starts, fire and forget
windWindModel | NoneNonewind to set as the step starts (a gust front, a calm)
until"altitude" | "airspeed" | "mode" | "armed" | "disarmed" | "text" | "waypoint" | "time" | "sim_time" | "landed" | NoneNonethe condition that ends the step, as in wait_until; omit it and the step ends in the tick its actions apply
valuefloat | str | NoneNonethe number, mode name or text the condition waits for
op">=" | "<=" | "=="">="comparison for numeric conditions
timeout_sfloat | NoneNonesim 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
relativeboolFalsesim_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_s is at most 3600 sim seconds.
  • Channels are 1 to 8 and PWM 800 to 2200. speedup is 0.05 to 50.
  • Mode names, in mode and in until: "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 a value; mode and text need a non-empty one.
  • relative applies to sim_time only. For time and relative sim_time, the default timeout is the wait plus 60 s, and a timeout shorter than the wait is refused.

One settled step, as fly_steps, steps_status and abort_steps return it.

FieldTypeMeaning
indexintthe step's position in the program, from 0
labelstr | None
reasonstrmet; timeout; died (SITL died, see snapshot.error); aborted (abort_steps, close_sitl, or an internal error named in the program's error)
t_start_sfloat | Nonesim time the step's actions applied; None if it never started
t_end_sfloatsim time the step settled
snapshotSnapshottaken in the tick the step settled
FieldTypeMeaning
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)
currentint | Noneindex of the running step; None when finished
stepslist[StepResult]results of the steps settled so far
errorstr | Nonewhy the program failed, if it did

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.

FieldTypeDefaultMeaning
speed_mpsfloat0mean horizontal wind, 0 to 60 m/s
from_degfloat0the direction it blows from, degrees
up_mpsfloat0mean 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)
scalefloat1multiplies the gust strength, up to 5
seedint | NoneNonerepeat 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.

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.

FieldTypeDefaultMeaning
cmdint | strrequiredMAV_CMD number or name: "NAV_WAYPOINT", "NAV_VTOL_TAKEOFF", "NAV_VTOL_LAND", "NAV_LOITER_TIME", "DO_CHANGE_SPEED", ... ("MAV_CMD_" optional)
north_mfloat0
east_mfloat0
alt_mfloat0above home
paramslist[float][]param1 to param4
tagstr""
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"},
])