End-to-end multilateration stack for live aircraft tracking.
- Go buyer (
main.go) connects to 4DSky sellers overneuron/ADSB/0.0.2. - Parsed observations are emitted as JSON (stdout fallback or Kafka mode).
- Python pipeline (
python/mlat/pipeline.py) routes messages (CPR vs MLAT path). - FastAPI server (
api/server.py) broadcasts fixes on/ws/tracksand serves/health. - React + Cesium frontend (
web/) renders aircraft tracks and sidebar stats.
Data path:
4DSky sellers -> Go buyer -> Python pipeline -> FastAPI WebSocket -> React/Cesium globe
sequenceDiagram
participant SN as Sensor Node
participant DI as Data Ingestion Service
participant CB as Correlation Buffer
participant ML as MLAT Solver
participant AT as Aircraft Tracker
participant AD as Anomaly Detector
participant TP as Trajectory Predictor
participant DC as Downstream Consumers
SN->>SN: Broadcast Mode-S messages (raw radio signals in Golang)
SN->>DI: Parse and normalize messages (Python, pyModeS, numpy)
DI->>DI: Attach sensor metadata (antenna, timestamp, ID)
DI->>CB: Forward normalized observations
rect rgb(40, 40, 40)
Note over CB: For each unique message
CB->>CB: Group observations by message payload and time window
CB->>CB: Deduplicate by sensor and payload
CB->>CB: Wait until minimum sensors threshold is met (configurable)
end
rect rgb(40, 40, 40)
Note over CB,ML: Sufficient sensors
CB->>ML: Provide grouped observations (with ECEF positions, TDOA vectors)
rect rgb(50, 50, 50)
ML->>ML: Estimate aircraft position using Levenberg-Marquardt (scipy) or Gradient Descent (PyTorch)
ML->>ML: Validate solution (Kalman Filter - altitude, altitude, geographic bounds)
ML->>AT: Emit resolved aircraft position (lat/lon/alt, methods=MLAT)
end
Note over CB: Insufficient sensors
CB->>CB: Discard or buffer incomplete group
end
AT->>AT: Maintain per-aircraft state (history, lat/lon, velocity)
AT->>AT: Smooth positions using Kalman Filter (filterpy, numpy)
AT->>AT: Provide initial guess for future MLAT solutions (network centroid or last known)
rect rgb(40, 40, 40)
Note over AT,AD: Parallel ML threads
AT->>AD: Send TDOA vectors for anomaly detection
AD->>AD: Run autoencoder (PyTorch) to detect outliers in TDOA patterns
AD->>AT: Flag anomalous observations for review or exclusion
end
AT->>TP: Provide recent ECEF position history
TP->>TP: Predict next position using LSTM (PyTorch)
TP->>AT: Return predicted position for short-term extrapolation
AT->>DC: Emit smoothed and predicted positions (JSON, API, Kafka/Redis/node)
DC->>DC: Visualize, store, or further process aircraft tracks
Note over SN: Hardware: SDR, Raspberry Pi, GPS
Note over DI: Python, pyModeS, numpy, asyncio
Note over CB: Python, custom logic
Note over ML: scipy, PyTorch, numpy
Note over AT: filterpy (Kalman), numpy
Note over AD: PyTorch (autoencoder)
Note over TP: PyTorch (LSTM)
Note over DC: FastAPI, Kafka/Redis/node & cloud storage
api/ FastAPI app + shared asyncio queue
internal/ Go ingestion modules (overrides, parser, publisher, stream)
python/mlat/ Routing, CPR, correlation, solver, tracker, ML modules
python/tests/ Unit + integration + runtime resilience tests
web/ React 19 + Vite + Tailwind + Cesium frontend
scripts/script.sh Buyer + API supervisor script (stdin pipe via FIFO)
systemd/hyperplane.service
- Go
1.24+ - Python
3.11+ uv(Python package manager)- Node.js
20+ pnpm.buyer-envandlocation-override.jsonat repository root
# from repo root
go mod tidy
uv sync --project python
pnpm --dir web install --frozen-lockfile
pnpm --dir web buildMLAT_READ_STDIN=1 uv run --project python python -m uvicorn api.server:app --host 0.0.0.0 --port 8000 < python/tests/fixtures/sample_observations.jsonOpen:
http://localhost:8000http://localhost:8000/health
Important: this input is finite. Once EOF is reached, fixes stop. Aircraft will:
- turn stale/gray in the UI after
30s(VITE_AIRCRAFT_STALE_MS, default30000) - be removed by backend after
120s(MLAT_STALE_AIRCRAFT_SECONDS, default120)
go build -o main_app .
chmod +x scripts/script.sh
APP_DIR="$(pwd)" bash scripts/script.shThen open http://localhost:8000.
# Go
go test ./internal/... -v
# Python
uv run --project python pytest python/tests -v
# Frontend type/build check
pnpm --dir web buildPhase 8 adds JSONL capture, offline trainers, solver benchmarking, and optional live loading of checkpoints via the Python Pipeline:
| Step | What it does |
|---|---|
| 8.1 Capture | python -m mlat.training.collect_data --fixes-out data/fixes.jsonl --groups-out data/mlat_groups.jsonl < observations.jsonl — append one JSON object per line for fixes and for correlated MLAT groups (pre-solve). |
| 8.2 Anomaly | After capture, python -m mlat.training.train_anomaly --groups-jsonl data/mlat_groups.jsonl — trains the TDOA autoencoder on successful scipy solves, writes checkpoints/anomaly_detector.pt and reports/anomaly_reconstruction.png. |
| 8.3 Trajectory | python -m mlat.training.train_trajectory --fixes-jsonl data/fixes.jsonl — trains the LSTM and writes checkpoints/trajectory_predictor.pt. |
| 8.4 Solvers | python -m mlat.training.compare_solvers --groups-jsonl data/mlat_groups.jsonl --limit 100 — timing and residual summary JSON under reports/. |
Live integration (optional): pass anomaly_checkpoint_path / trajectory_checkpoint_path to Pipeline, or when using stdin ingest with the API, set MLAT_ANOMALY_CHECKPOINT and/or MLAT_TRAJECTORY_CHECKPOINT (paths to .pt files). See python/mlat/pipeline.py for anomaly_threshold_override and prediction_stale_seconds.
Go ingestion:
LOCATION_OVERRIDE_FILE(default:location-override.json)PUBLISH_MODE(kafkaorstdout, default:kafka, with stdout fallback if Kafka unavailable)KAFKA_BROKERS(comma-separated; optional)KAFKA_TOPIC(default:modes-observations)
FastAPI / pipeline runtime:
MLAT_READ_STDIN=1to enable in-process stdin ingest inapi.serverMLAT_ANOMALY_CHECKPOINT— optional path toanomaly_detector.pt(TDOA autoencoder)MLAT_TRAJECTORY_CHECKPOINT— optional path totrajectory_predictor.pt(LSTM gap-fill)MLAT_STALE_AIRCRAFT_SECONDS(default:120)MLAT_STALE_SWEEP_INTERVAL_SECONDS(default:5)
Frontend:
VITE_AIRCRAFT_STALE_MS(default:30000)
The current production service is hyperplane.service and it runs scripts/script.sh.
# on EC2
cd ~/hyperplane
go build -o main_app .
chmod +x scripts/script.sh
sudo cp systemd/hyperplane.service /etc/systemd/system/hyperplane.service
sudo systemctl daemon-reload
sudo systemctl enable hyperplane
sudo systemctl restart hyperplane
sudo systemctl status hyperplane --no-pager
sudo journalctl -u hyperplane -fOpen http://<EC2_PUBLIC_IP>:8000 after allowing TCP 8000 in the security group.
Cause: no new fixes are arriving.
Checks:
- See if stdin ended (
MLAT stdin ingest stopped (EOF reached)in logs). - Confirm
/healthfixes_per_minuteis non-zero while the source is running. - Use a continuous stream (live buyer) instead of one-shot fixture redirection.
Temporary tuning for demos:
MLAT_STALE_AIRCRAFT_SECONDS=600 VITE_AIRCRAFT_STALE_MS=120000 ...- Verify backend is healthy:
curl http://localhost:8000/health - Verify WebSocket is connected in sidebar status.
- Confirm incoming observations include decodable ADS-B position frames and/or valid MLAT groups.