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

Position decoding bugfixes + improvements to position filtering and relative decoding #22

Merged
merged 8 commits into from
Nov 3, 2019

Conversation

wiedehopf
Copy link
Contributor

First 2 patches: Bugfixes
Other patches: Improving filtering and relative CPR

After having tested these changes for a couple of days against a reference version getting the same beast input, all seems solid.
I turned on the speed filter debugging for both versions, and the old version definitely produced some false positives especially for landing aircraft as the new ground speed is used as reference while the majority of the landing run was at higher speed.
I haven't seen any instances of the new filter permitting actual bogus positions where the old version filter didn't.

The pos_reliable change works very well as it allows getting some positions further away as the aircraft is leaving the coverage of the receiver. If a stray position message then reaches the receiver, local CPR decoding can be done where it couldn't be before giving you a position.
It's not a huge number of position decodes but they are in areas where you get few position reports, so it matters in my opinion.
In the last patch i've added a console option in regards to pos_reliable, so you can revert to the old behaviour. But it should be an all around improvement using at least 2 as a value for filterPersistence.

I'm not sure which value you would prefer in regards to stale aircraft in the JSON file.
90 seconds seems plenty, but that's up to you
As aircraft are now retained twice as long, to keep the current behaviour 300 seconds instead of 90 would be the way to go.

When we have ADS-B CPRs and get for example an MLAT synthetic CPR, the
a->cpr variables are not changed because the source is lower quality.
Yet the updatePosition function is called and lower quality CPR is used.
Fix that by only calling updatePosition if the a->cpr variables got
updated.
In case of surface global CPR one CPR can be up to 50 seconds old
leading to unlogically short expiration of the resulting position.
Instead use accept_data to update position_valid when a new position is
dedoced.
Also check the result of accept_data to decide if we actually want to
update the position.
This is important if we do local CPR from a synthetic MLAT message.
One ADS-B CPR and the positon might not be stale when the position is
from a local CPR decode. Now we avoid overriding the ADS-B position if
it's not stale yet, this is exactly what accept_data checks for.
For global CPR we don't need to check the result, do it anyway for
consistency.
If we have already decoded multiple global CPRs, a disagreeing global
CPR position means the newly decoded position is bad. This new position
is discarded while the old position stays valid.
Before the old position would be invalidated immediately when having a
global CPR failure.
Important for the new global_bad handling logic (pos_reliable).
Aircraft often drop in and out of reception. Being able to do relative
CPR and range checks even if no position was decoded for longer than 70
seconds is very useful to reception.
Due to the previously pos_reliable counter and the speed check this
should even decrease the number of wrong positions displayed while
increasing the number of aircraft relative decodes.
Especially useful for people with spotty reception or surface
positions.
Maximum consecutive implausible positions from global CPR it takes to
invalidate the known aircraft positions.
If we haven't received that many odd or even CPR messages resulting in a
good global position yet, it will take less consecutive implausible
positions to invalidate the position.
Default is 2.
@Mictronics Mictronics merged commit b547517 into Mictronics:dev Nov 3, 2019
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