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

Dev #21

Closed
wants to merge 9 commits into from
Closed

Dev #21

wants to merge 9 commits into from

Conversation

wiedehopf
Copy link
Contributor

So this is now much better tested than before.
And i've identified some pitfalls i didn't sufficiently consider before.

I'd probably recommend just reverting the patches i submitted for the master branch.
While they are not totally broken, it'll make it easier to merge the dev branch :)

Testing especially range set to 0 (infinite) provided some nice corner cases.
Due to the global_cpr_bad handling, the filtering needs to me more conservative.
But in my testing i didn't notice the changes making the filter less effective.
What the changes did do though is reduce the false positive filter hits for landing/departing aircraft and in some other situations.

Note that the first patch will reduce the number of global CPRs if you have MLAT enabled as the MLAT CPRs are correctly discarded as long as the ADS-B CPRs are not stale.

An example of the improvements using ADS-B only data from a receiver with view on SFO:
Left side is after the patches, right side is before, you can clearly see after dropping out of view of the receiver the new position is more quickly acquired when the aircraft start their takeoff run.
Thin lines are the intermittent track normally depicted with dotted lines.

https://imgur.com/a/UAL9TYE

These are the CPR stats compared between the commit making the aircraft_relative CPR stat functional and the final commit.
As you can see the number of aircraft_relative CPR has increased because it is used for aircraft that were out of view longer.

"cpr":                      {              {
"surface":                  13793,         13793,
"airborne":                 341607,        341607,
"global_ok":                349014,        349022,
"global_bad":               12,            11,
"global_range":             0,             0,
"global_speed":             8,             7,
"global_skipped":           278,           278,
"local_ok":                 4507,          4990,
"local_aircraft_relative":  4507,          4990,
"local_receiver_relative":  0,             0,
"local_skipped":            1867,          1377,
"local_range":              0,             0,
"local_speed":              3,             0,
"filtered":                 0              0

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.
pos_reliable is then used to invalidate the positon if the first global
CPR to be decoded yielded a bad position.
If we have already received 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.
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.
@Mictronics
Copy link
Owner

Reverting master, shall we go back to 18527a4 and drop all your commits then?

@wiedehopf
Copy link
Contributor Author

Do as you wish with the master branch, it's your decision.
You can leave the first patch in if you want, that i'm very certain about as it's only a bugfix:
"Fix update_position being called when neither CPR changed"

I'll actually have one follow-up change to the series, i'll make it an extra commit, will be her in a moment.

Even a well established position, as in lots of consistent global CPR
decodes, can be wrong due to transponder faults for example.
In that case 5 independent global CPR decodes will be sufficient to
invalidate the established position.
@wiedehopf
Copy link
Contributor Author

I'd also like to increase the time precision in the JSON file a bit, are you up for that?
From tenth of a second to hundreds of a second, how does that sound?

@Mictronics
Copy link
Owner

What's the purpose of increased precision?

@wiedehopf
Copy link
Contributor Author

I'm doing some position filtering in the web interface itself, and it takes some variability due to rounding errors out of it.
As i said, just one extra digit is enough.

@wiedehopf
Copy link
Contributor Author

Oh forgot to mention the webinterface i'm talking about, i'm working on this: https://github.com/wiedehopf/tar1090#tar1090

If you fancy anything, feel free to integrate it.
(Yes i could change your web interface, but having it separate allows for much more design choice freedom)

@wiedehopf
Copy link
Contributor Author

I should have mentioned initially, it's only seen, seen_pos and now which i would increase from %.1f to %.2f

@wiedehopf
Copy link
Contributor Author

I'll do a separate pull request some other time in regards to the time precision in the JSON, no need to complicate this PR.

@wiedehopf
Copy link
Contributor Author

The 20 and the 4 number, which are thrown around in the last patch were from a different mindset when i didn't reset both CPRs on a failed speed check.

Actually it probably makes sense to just invalidate the position as soon as a 2nd pair of CPRs fails the speed check.
There might be prettier ways to implement this as limiting the two variables to 2, but this works.

I'll just add that as a new patch for now, if you prefer i can rebase those last two patches into the patch that introduces pos_reliable though.

@wiedehopf
Copy link
Contributor Author

wiedehopf commented Oct 28, 2019

So this got messy and i'd like to rebase the PR and will test it for a week.
(leaving this branch in the current state and using my dev2 branch)

Then i'll make a new PR. Sorry for all the trouble.

P.S.: If you want to chat a little more relaxed about the changes, come by the adsbexchange discord:
https://discord.gg/P6QZ5KA

@wiedehopf wiedehopf closed this Oct 28, 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