mavsdk_drone_show

Mission State Terminology Fix - Summary

Problem Solved

The application had confusing state terminology that conflicted with PX4’s actual arming status:

❌ CONFUSING OLD SYSTEM:

vs PX4 Real Arming:

✅ SOLUTION IMPLEMENTED

1. Renamed States (Backend/Drone-side)

File: src/enums.py

class State(Enum):
    IDLE = 0
    MISSION_READY = 1      # Was: ARMED (Mission loaded, waiting for trigger)  
    MISSION_EXECUTING = 2  # Was: TRIGGERED (Mission is executing)
    UNKNOWN = 999

2. Updated All Code References

Files Updated:

Changes:

3. Enhanced Frontend Display

New File: app/dashboard/drone-dashboard/src/constants/droneStates.js

export const DRONE_SHOW_STATES = {
  0: 'Idle',                    // No mission loaded
  1: 'Mission Ready',           // Mission loaded, waiting for trigger time
  2: 'Mission Executing',       // Mission is currently executing
  999: 'Unknown'                // Unknown/error state
};

Updated Components:

4. Visual Improvements

New CSS Classes in DroneWidget.css:

Mission State Badge Color Border Animation
Idle Gray None None
Mission Ready Orange Orange left border Pulsing
Mission Executing Teal Teal left border Fast pulse

🎯 What Users See Now:

Before Fix:

After Fix:

🔄 Mission Workflow Now Clear:

  1. Idle (Gray) → No mission loaded
  2. Mission Ready (Orange, pulsing) → Mission loaded, waiting for trigger time
  3. Mission Executing (Teal, fast pulse) → Mission running
  4. Back to Idle → Mission completed

🛡️ Functionality Preserved:

📋 Files Modified:

Backend/Drone-side:

Frontend:

🚀 Benefits:

  1. No More Confusion - PX4 arming vs Mission states are clearly separate
  2. Better User Experience - Clear visual indicators for mission workflow
  3. Professional Look - Matches industry standards (QGroundControl style)
  4. Maintainable - Self-documenting code with clear naming
  5. Zero Functional Changes - Same behavior, better presentation

🧪 Testing Notes:

The changes are semantic only - all logic flows are identical:

Test these workflows:

  1. Load mission → Should show “Mission Ready” with orange badge
  2. Trigger mission → Should show “Mission Executing” with teal badge
  3. Complete mission → Should return to “Idle” with gray badge
  4. Check PX4 arming status shows independently from mission state

Author: Claude Code Assistant
Date: 2025-09-06
Impact: UI/UX Enhancement, No Functional Changes