Commit Graph

72 Commits

Author SHA1 Message Date
Oliver Jowett e0f794b1a5 Track MRAR data per-aircraft and emit in aircraft.json 2021-07-29 19:04:54 +08:00
Oliver Jowett c7675b3cd1 Add missed expiry code for emergency / nac_v fields; initialize emergency_valid.
(noticed by @wiedehopf)

Fixes #96
2021-01-15 18:20:50 +08:00
George Joseph 68e95c06cc Interactive mode updates
These updates were designed to assist those using interactive
mode to tune antennas and SDR gain.

* Add options to display distance and bearing in interactive mode

  Distance and bearing instead of latitude and longitude can now be
  displayed in interactive mode using the following options to
  dump1090-fa and view1090-fa.

  --interactive-show-distance   Show aircraft distance and bearing
                                instead of aircraft lat/lon
                                (requires --lat and --lon)
  --interactive-distance-units  Distance units ('km', 'sm', 'nm')
                                (default: 'nm')"

  You have to specify a reference --lat and --lon for this to
  work of course.

* A new line now shows at the top of the interactive display that
  has for the current sample:

  Total valid aircraft count
  Vidible aircraft count
     Will be less than total if the screen hasn't enough lines to show
     them all.
  Max RSSI
  Min RSSI
  Mean RSSI
  Max Distance

 Tot:  47 Vis:  47 RSSI: Max 25.4+ Mean -29.5 Min -36.9-  MaxD:  197.3nm+

* Add max distance and min/max RSSI indicators

  A '+' after the distance in a row indicates it's the row with the
  maximum distance.

  A '+' after the RSSI in a row indicates it's the row with the highest
  RSSI.

  A '-' after the RSSI in a row indicates it's the row with the lowest
  RSSI.

  The summary line at the top of the screen always shows the values for
  ALL aircraft, even those not visible.  The row indicators only mark
  visible rows though.

  In this example, the first aircraft is both the farthest away and has
  the weakest RSSI.  The second aircraft has the strongest RSSI.

 Tot:  47 Vis:  47 RSSI: Max 25.4+ Mean -29.5 Min -36.9-  MaxD:  197.3nm+     -
 Hex    Mode  Sqwk  Flight   Alt    Spd  Hdg  Dist(nm) Bearing  RSSI  Msgs  Ti
────────────────────────────────────────────────────────────────────────────────
 A8D5A4 S2                   34000  438  252   197.3+      85  -36.1-   26  2
 A39A13 S2ac  5740  FFT525   30750  439  256    98.8       68  -25.4+  123  0
 A70B23 S2ac  2744  LXJ553   43000  419  258   136.1       39  -33.6   174  0

* Finally, a new option '--interactive-callsign-filter' has been added
  to allow filtering interactive by callsign.  The value can be a
  simple string, in which case aircraft with that string anywhere in its
  callsign will be displayed, or a regular expression should you want a
  more precise match.

  Examples:
    --interactive-callsign-filter UAL
      will match all aircraft with UAL anywhere in its callsign.
    --interactive-callsign-filter "^UAL"
      will match only those callsigns that start with UAL.
    --interactive-callsign-filter "^(UAL|AAL)"
      will match only those callsigns that start with UAL or AAL.
    --interactive-callsign-filter "^N[0-9]" or "^N[[:digit:]]"
      will match only those callsigns that start with "N" and a number

  If you need more info on regular expressions, see this link:
  https://en.wikipedia.org/wiki/Regular_expression
2020-09-29 06:23:55 -06:00
Rosen Penev 0df937e9c6
fix -Wmissing-declaration warnings
This should result in a smaller size.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-29 16:42:21 -07:00
Oliver Jowett d471249f17 Track ADS-B version separately for direct ADS-B, TIS-B, ADS-R
(both because direct vs ground station might be different, and
to avoid characterizing ADS-R or TIS-B aircraft as being DO-260B
when they're not)
2019-12-12 09:21:26 -06:00
Oliver Jowett 201cb2f466
Merge pull request #55 from wiedehopf/cpr_fix
CPR / Position update fix / improvement
2019-12-04 18:36:07 +08:00
Oliver Jowett ea9f81c605 Remove first_message field as it's now unused. 2019-11-28 13:56:11 +08:00
Oliver Jowett b2e9153653 Add stats for unreliable tracks 2019-11-27 21:41:33 +08:00
Oliver Jowett ce89cd08d9 Groundwork to track "reliable" messages & aircraft.
A "reliable" message is a DF17 or DF11 with good CRC.
A "reliable" aircraft is one that's probably real - we decide it's reliable when
we've seen enough reliable messages, or just enough messages in total, that it's unlikely
to be noise.
2019-11-27 20:51:23 +08:00
Matthias Wirth f67a31823b use accept_data for setting position_valid
Check the return value from accept_data to determine if we want to
use the decoded position.
Avoid a position from local CPR with a synthetic MLAT message being used
when the position may still be valid and either odd or even CPR already
stale allowing the MLAT CPR to be used.
Set the position expiration correctly for global surface CPR, the
previous code could have an up to 50 second old CPR being used, which
would result in combine_validity setting an expiry time for the position
only 10 seconds in the future.
2019-11-01 07:31:39 +01:00
Matthias Wirth aa2b205481 Fix update_position being called when neither CPR changed
When we have ADS-B CPRs and get for example a MLAT synthetic CPR, don't
call updatePosition as this messes up the position state.
2019-10-18 21:02:12 +02:00
Oliver Jowett f46640a5c2 Track and report autopilot FMS/MCP separately; also report autopilot altitude source. 2019-03-19 18:44:09 +00:00
Oliver Jowett c8501cb41c Compute ADS-B v0 NACp/SIL from position message type 2018-09-19 17:09:11 +01:00
Oliver Jowett 3c02e8419d Fix another Rc decoding error. Fix Rc comments. 2018-09-19 17:05:39 +01:00
Oliver Jowett b327848d75 Fix Rc comparison logic 2018-09-17 22:40:48 +01:00
Oliver Jowett 39b008472f Disable 7x00 -> emergency status translation.
This doesn't add information and it can actually obscure the true
source of the data (ADS-B emergency vs ADS-B squawk).
2018-07-06 19:54:58 +01:00
Oliver Jowett 60c762c843 Version bump to 3.6.1~dev.
Fix tracking of NICbaro.
2018-06-12 01:13:03 +01:00
Oliver Jowett 7749316540 Fix 10NM Rc value 2018-05-09 14:57:52 +01:00
Oliver Jowett d5eccc30a4 If we see a bad NIC supplementary bits combination, return RC_UNKNOWN 2018-05-09 14:57:29 +01:00
Oliver Jowett a8fe04f856 Derive emergency status from squawk if not otherwise provided. 2018-02-23 19:02:33 +00:00
Oliver Jowett f323745ead Don't track icao 000000 as an aircraft
(but do still decode messages for it)
2018-02-23 18:10:26 +00:00
Oliver Jowett 44e8913c2d Whitespace cleanups 2018-01-09 17:13:34 +00:00
Oliver Jowett 2ce2af1685 Tweak when we allow updates to air/ground status. 2018-01-09 14:47:08 +00:00
Oliver Jowett ea1e9c336b Decode/emit emergency/priority status 2018-01-09 14:43:58 +00:00
Oliver Jowett 079061df3c SIL stuff 2017-12-07 13:36:07 -06:00
Oliver Jowett 161d2d8ded More WIP 2017-12-07 10:34:08 -06:00
Oliver Jowett 6986b3847f WIP on new faup1090 output, data aging, refactoring 2017-12-02 17:38:33 +00:00
Oliver Jowett c6d7f1ec6f Expire tracked true_heading, intent_modes 2017-06-16 11:42:41 +01:00
Oliver Jowett 382554a250 Tweak tracking of AP modes, emit in json & faup1090 output 2017-06-16 10:39:01 +01:00
Oliver Jowett 1ec32903ba Rework heading/track to include HRD/TAH.
Clean up TIS-B flag output.
2017-06-15 21:07:53 +01:00
Oliver Jowett 27b0e9c40f Rename TARGET_* -> INTENT_ALT_*
Rearrange the intent tracking a bit.
2017-06-15 18:23:28 +01:00
Oliver Jowett 2142d2edf5 Whitespace changes only: cleaning up trailing whitespace at EOL 2017-06-15 18:17:07 +01:00
Oliver Jowett 98d64483d6 WIP: More Comm-B & ADS-B decoding. 2017-06-15 18:07:40 +01:00
Oliver Jowett d3fad32d5e Merge remote-tracking branch 'upstream/master' into dev 2016-10-14 21:35:31 +01:00
Oliver Jowett 4cb17c194c More tweaking to A/C tracking. 2016-10-11 21:29:39 +01:00
Oliver Jowett 25ea6d398b Overhaul mode A/C matching to be much cheaper.
The old matching process which tracked mode A values as pseudo-aircraft
got very, very expensive with a large number of mode A/C messages (and
with lots of single-bit errors, which seems common with a Beast doing
the reception)

Instead just count A/C messages directly into a 4096-entry array (which
is very fast) and periodically scan the mode S aircraft list to see if
we can match anything up (which is fixed overhead + cost proportional
to the number of mode S aircraft)
2016-10-11 18:00:11 +01:00
Oliver Jowett 52fe01c860 Track CPR encoding type directly rather than inferring it from airground.
(airground can change even while airborne if SPI/Alert status gets set)
2016-10-02 00:16:29 +01:00
Oliver Jowett dda5411882 faup1090: Track Comm-B ACAS RA separately to ES ACAS RA as it's useful to see both reported.
Fix repeated reporting of ES ACAS RA reports.

(cherry picked from commit 14a003710e)
2016-10-01 15:22:32 +01:00
Oliver Jowett 14a003710e faup1090: Track Comm-B ACAS RA separately to ES ACAS RA as it's useful to see both reported.
Fix repeated reporting of ES ACAS RA reports.
2016-09-24 16:09:38 +01:00
Oliver Jowett 8d8443f3dc Track the "best" addrtype we ever saw for an aircraft. 2016-09-14 16:54:00 +01:00
Oliver Jowett 2636353e4a Fix aircraft-relative position validity check. 2016-09-02 18:41:59 +01:00
Oliver Jowett 954034855a Make faup1090 emit some interesting messages when they occur. 2016-08-28 01:29:37 +01:00
Oliver Jowett 54ca2c7fb2 WIP big rewrite of message decoding / aircraft tracking. 2016-08-27 14:34:14 +01:00
Oliver Jowett 08c14484cd Use the haversine formula for small greatcircle distances, rather
than clamping to zero.
2016-08-26 11:36:29 +01:00
Oliver Jowett 308b928f8c If maxrange is 0, we cannot do receiver-relative CPR at all. 2016-08-26 11:31:32 +01:00
Oliver Jowett 43906f994b Limit aircraft-relative CPR to 50km. 2016-08-26 11:30:46 +01:00
Oliver Jowett 7a58e3cdc5 Move Mode C altitude calc into mode A/C message decoding.
If SPI is set, it cannot be mode C.
2016-03-20 19:47:27 +00:00
Oliver Jowett 214bc0e587 Treat zero-or-missing signal levels as "no information" and don't include them in RSSI. 2016-02-24 11:55:01 +00:00
Oliver Jowett e101351b6e Enforce max-range on mlat results (but still skip the speed check)
Fixes #97
2016-02-05 15:42:34 +00:00
Oliver Jowett d9eec668cf Track what data we got via TIS-B, report it as such. 2016-01-21 19:42:37 +00:00