decodeFlightModeLabel
sabrobotix-suite / lib/drone-control-session / decodeFlightModeLabel
Function: decodeFlightModeLabel()
decodeFlightModeLabel(
flight,unknownLabel):string
Defined in: lib/drone-control-session.ts:743
The name of the mode a vehicle is in.
The ArduPilot tables are shared with Harlock and the BMS
(@sab-group-srl/vehicle-model), which picks the table from the vehicle type
instead of assuming a copter. What is the Suite's own is how an undecodable
mode reads: unknownLabel when no mode was reported, MODE <n> when one was
but cannot be named — an operator can look up MODE 4, "Unknown mode" tells
them nothing.
The payload shape that carries neither type — a relay that sends only
modeRaw and armed — keeps the copter table, because for those it is what
the Suite has always shown and is still the best available guess.
Parameters
flight
Pick<DroneControlFlightData, "autopilotType" | "vehicleType" | "customMode"> | null
unknownLabel
string
Returns
string