Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.
/ readsb Public archive

Some improvements for position updating / CPR handling #19

Merged
merged 2 commits into from
Oct 19, 2019
Merged

Some improvements for position updating / CPR handling #19

merged 2 commits into from
Oct 19, 2019

Conversation

wiedehopf
Copy link
Contributor

Just found this bug in dump1090-fa and suspected you still had the same code.

This in particular improves the situation when aircraft are on the ground at an airport and you are getting MLAT positions for them as well.
Getting an MLAT position while having a good ADS-B position could before these fixes completely invalidate the position, also an MLAT position could be in the json without being marked as such.

When we have ADS-B CPRs and get a MLAT synthetic CPR, don't call
updatePosition as this messes up the position state.
If we receive a new CPR and the old CPR is the one with bad data, we
will throw the data away again.  But if we are lucky and receive the
CPR that was bad, we get a good position again faster.  Also this
makes the speed check impossible on the next decode, which is bad.
Instead move the position validity closer to expiration.
That should help with wrongly accepting a bad position and failing
all speed checks afterwards.
@Mictronics Mictronics merged commit 033eb5a into Mictronics:master Oct 19, 2019
@wiedehopf
Copy link
Contributor Author

Just as an FYI, the second patch is somewhat questionable.
The expires variable is actually in milliseconds, so i should subtract 25 000 to do what i want.
And the relative/local CPR will reset the expiration timer to it's full length so subtracting 25 seconds might not even be effective enough to correct a completely bogus position.

I'm working on a better solution.

@Mictronics
Copy link
Owner

Go ahead. And thanks for contributing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants