Implement CPR position recovery for better position validation #18
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: olemd/skyview#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The current position validation logs show many aircraft with impossible speeds (e.g., 25+ million knots) due to CPR (Compact Position Reporting) decoding errors. These occur when odd and even CPR frames get mixed up or decoded incorrectly.
Current Behavior
Root Cause
CPR encoding uses odd/even frame pairs to encode precise positions in a compact format. When:
The decoder can produce wildly incorrect positions leading to impossible calculated speeds.
Proposed Solution
Implement CPR position recovery mechanism:
Frame Pair Management:
Recovery Strategies:
Fallback Options:
Benefits
Implementation Notes
Files to Modify
References
Root Cause Identified: CPR Zone Ambiguity Bug
I've identified the specific bug causing aircraft positioning errors like 4ACAB2 showing near Helsinki when actually approaching Porsgrunn.
The Bug Location
File:
internal/modes/decoder.go
, lines 528-548 indecodeCPRPosition()
The Problem
The CPR decoding algorithm has a critical flaw in zone ambiguity resolution:
This causes coordinate mixing - correct latitude from one zone solution paired with longitude from a different zone solution, creating invalid positions.
Real-World Impact
The Fix Required
Replace the current mixed coordinate approach with:
Code Location
This fix will resolve the zone ambiguity issues causing aircraft to appear hundreds of kilometers from their actual positions.