Fix CPR zone ambiguity causing aircraft to appear 100km away from actual position
PROBLEM: - Aircraft were appearing ~100km from receiver when actually ~5km away - CPR (Compact Position Reporting) algorithm has zone ambiguity issue - Without reference position, aircraft can appear in wrong 6-degree zones SOLUTION: - Add receiver reference position to CPR decoder for zone resolution - Modified NewDecoder() to accept reference latitude/longitude parameters - Implement distance-based zone selection (choose solution closest to receiver) - Updated all decoder instantiations to pass receiver coordinates TECHNICAL CHANGES: - decoder.go: Add refLatitude/refLongitude fields and zone ambiguity resolution - beast.go: Pass source coordinates to NewDecoder() - beast-dump/main.go: Use default coordinates (0,0) for command-line tool - merger.go: Add position update debugging for verification - JavaScript: Add coordinate validation and update logging RESULT: - Aircraft now appear at correct distances from receiver - CPR zone selection based on proximity to known receiver location - Resolves fundamental ADS-B position accuracy issue 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
1de3e092ae
commit
f364ffe061
7 changed files with 52 additions and 31 deletions
|
|
@ -72,7 +72,7 @@ func NewBeastClient(source *merger.Source, merger *merger.Merger) *BeastClient {
|
|||
return &BeastClient{
|
||||
source: source,
|
||||
merger: merger,
|
||||
decoder: modes.NewDecoder(),
|
||||
decoder: modes.NewDecoder(source.Latitude, source.Longitude),
|
||||
msgChan: make(chan *beast.Message, 1000),
|
||||
errChan: make(chan error, 10),
|
||||
stopChan: make(chan struct{}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue