PX4 flight anomaly detection via conservation spectral analysis — detect attitude failures, GPS glitches, and motor failures from EKF2 state sequences.
Proof of concept applying the conservation spectral framework to PX4 autopilot data. Simulates 16-dimensional flight states (quaternion + velocity + position + gyro + accel), injects three types of anomalies, and detects them through conservation ratio drops in sliding-window spectral analysis.
- Flight state simulator — synthetic PX4 EKF2 16D state sequences with smooth SLERP interpolation
- Three anomaly types — sudden attitude change, GPS glitch, motor failure
- Conservation-based detection — sliding window Laplacian, track CR drops
- Spectral fingerprinting — compare healthy vs unhealthy flight signatures
- Threshold comparison — conservation detection vs simple statistical thresholding
- Publication-quality visualization — 3D trajectories, CR timeseries, spectral fingerprints
pip install numpy scipy matplotlib scikit-learn
python demo.pyOutputs go to output/ with PNG plots.
simulator.py # FlightState + synthetic flight generation + anomaly injection
detector.py # Conservation-based anomaly detection pipeline
visualize.py # Professional dark-themed plots
demo.py # End-to-end demo pipeline
Part of the SuperInstance ecosystem:
- conservation-spectral-python — Core SDK
- anomaly-atlas — Unified anomaly detection across domains
- px4-conservation-poc — PX4-specific proof of concept (this repo)
MIT