Skip to content

Commit

Permalink
max distance and range histogram: require certain ADS-B quality
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Jun 10, 2024
1 parent e0f4149 commit 13138f5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion track.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,14 @@ static void setPosition(struct aircraft *a, struct modesMessage *mm, int64_t now
a->receiver_distance = mm->receiver_distance;
a->receiver_direction = bearing(Modes.fUserLat, Modes.fUserLon, a->lat, a->lon);

if (mm->source == SOURCE_ADSB || mm->source == SOURCE_ADSR) {
// nac_p >= 2 accuracy better than 4 nmi
// decoded_rc less than 5 * nmi
if (mm->source == SOURCE_ADSB
&& trackDataValid(&a->nac_p_valid) && a->nac_p >= 2
&& mm->decoded_rc != 0 && mm->decoded_rc < 5 * 1852
) {
update_range_histogram(a, now);
} else if (mm->source == SOURCE_ADSR) {
update_range_histogram(a, now);
}

Expand Down

0 comments on commit 13138f5

Please sign in to comment.