BEAST decoding produces incorrect positions hundreds of km off target #35

Open
opened 2025-09-01 09:40:50 +02:00 by olemd · 0 comments
Owner

Problem Description

BEAST format decoding occasionally produces aircraft positions that are hundreds of kilometers away from their actual location. This creates phantom aircraft jumps and unreliable position tracking.

Current Behavior

  • Aircraft positions decoded from BEAST format messages sometimes appear several hundred km from their true location
  • Position validation logs show "impossible speed" errors (e.g., 15176 knots) indicating massive position jumps
  • The system detects these as validation errors but the root cause is incorrect decoding

Evidence from Logs

[POSITION_VALIDATION] ICAO 486495: REJECTED - Impossible speed: 2845 knots (max allowed: 2000 knots)
[POSITION_VALIDATION] ICAO 4CAD86: REJECTED - Impossible speed: 2937 knots (max allowed: 2000 knots)
[POSITION_VALIDATION] ICAO 4CAD86: REJECTED - Impossible speed: 15176 knots (max allowed: 2000 knots)

Technical Details

Likely Issues:

  • CPR (Compact Position Reporting) decoding errors in /internal/modes/decoder.go
  • Missing or incorrect handling of even/odd CPR frame pairs
  • Possible issues with local/global CPR decoding logic
  • Reference position handling may be incorrect

Affected Code:

  • /internal/modes/decoder.go - CPR decoding functions
  • /internal/beast/parser.go - BEAST message parsing
  • /internal/merger/merger.go - Position validation logic

Impact

  • Safety: Incorrect position data could mislead users about actual aircraft locations
  • Reliability: Creates phantom tracks and impossible aircraft movements
  • User Trust: Erratic position jumps undermine confidence in the system

Investigation Needed

  1. Review CPR decoding implementation for correctness
  2. Verify even/odd frame pairing logic
  3. Check reference position calculation for local decoding
  4. Validate coordinate wrapping and edge cases
  5. Compare with reference implementations (dump1090, etc.)

Potential Solutions

  • Improve CPR decoding algorithm
  • Add more robust position validation before accepting decoded positions
  • Implement position smoothing/filtering
  • Use previous known good positions as reference for local CPR decoding
  • Add comprehensive unit tests for CPR edge cases
## Problem Description BEAST format decoding occasionally produces aircraft positions that are hundreds of kilometers away from their actual location. This creates phantom aircraft jumps and unreliable position tracking. ## Current Behavior - Aircraft positions decoded from BEAST format messages sometimes appear several hundred km from their true location - Position validation logs show "impossible speed" errors (e.g., 15176 knots) indicating massive position jumps - The system detects these as validation errors but the root cause is incorrect decoding ## Evidence from Logs ``` [POSITION_VALIDATION] ICAO 486495: REJECTED - Impossible speed: 2845 knots (max allowed: 2000 knots) [POSITION_VALIDATION] ICAO 4CAD86: REJECTED - Impossible speed: 2937 knots (max allowed: 2000 knots) [POSITION_VALIDATION] ICAO 4CAD86: REJECTED - Impossible speed: 15176 knots (max allowed: 2000 knots) ``` ## Technical Details **Likely Issues:** - CPR (Compact Position Reporting) decoding errors in `/internal/modes/decoder.go` - Missing or incorrect handling of even/odd CPR frame pairs - Possible issues with local/global CPR decoding logic - Reference position handling may be incorrect **Affected Code:** - `/internal/modes/decoder.go` - CPR decoding functions - `/internal/beast/parser.go` - BEAST message parsing - `/internal/merger/merger.go` - Position validation logic ## Impact - **Safety**: Incorrect position data could mislead users about actual aircraft locations - **Reliability**: Creates phantom tracks and impossible aircraft movements - **User Trust**: Erratic position jumps undermine confidence in the system ## Investigation Needed 1. Review CPR decoding implementation for correctness 2. Verify even/odd frame pairing logic 3. Check reference position calculation for local decoding 4. Validate coordinate wrapping and edge cases 5. Compare with reference implementations (dump1090, etc.) ## Potential Solutions - Improve CPR decoding algorithm - Add more robust position validation before accepting decoded positions - Implement position smoothing/filtering - Use previous known good positions as reference for local CPR decoding - Add comprehensive unit tests for CPR edge cases
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: olemd/skyview#35
No description provided.