Skip to main content

State Machine

The OnboardAgent uses a state machine to manage the lifecycle of drone operations, from mission planning to execution and emergency handling.

State Machine Diagram

State Descriptions

StateDescription
IDLEThe default state where the agent is waiting for a new job or command.
DOWNLOADINGThe agent is fetching the mission bundle (waypoints, metadata) from S3.
UPLOADINGPost-download phase where local resources are being prepared or validated before flight.
ARMEDThe drone's flight controller is armed and ready for takeoff.
IN_FLIGHTThe drone is actively executing the mission (i.e., performing a survey).
COMPLETINGFinalizing the mission, ensuring telemetry is synced and the job is marked as successful.
ERRORA critical fault occurred. The agent requires a reset event to return to IDLE.
CANCELLINGTriggered by an operator cancel or an emergency during flight. Handles safe termination.
REJECTEDThe mission was rejected due to validation failure or safety constraints.
MANUALThe operator has taken manual control (via gamepad, or onscreen joystick), overriding autonomous flight.
FLASHINGThe agent is updating the flight controller (PX4) firmware.

Event Triggers

  • download: Initiated when an AWS IoT Job is received.
  • upload: Transition after mission bundle verification.
  • arm/fly: Steps to transition from preparation to active autonomous mission.
  • manual: Overrides autonomous states to allow direct pilot control via FleetCoreDesktop.
  • emergency/cancel: Safely aborts the current operation and transitions to CANCELLING.
  • error: Can occur in almost any state, pushing the agent into the ERROR recovery state.
  • reset: Clears the error state and returns the agent to IDLE.