watson / mode-s-aircraft-store

A utility library for keeping track of active aircrafts and their position based on their Mode S messages
MIT License
10 stars 5 forks source link

Doesn't handle velocity messages properly #2

Open mbaum0 opened 5 years ago

mbaum0 commented 5 years ago

I don't think airborne velocity/heading messages aren't parsed properly in the store. On line 58 of aircraft.js you check for sub types 1 or 2 in order to set heading and speed. I believe this should check for sub types 3 and 4 which are airborne position messages (1/2 are ground).

The mode-s-decoder project checks for types 3/4 in index.js line 227. One of these is off.

I found type information from: https://mode-s.org/decode/adsb/airborne-velocity.html

Let me know if I'm crazy or not!

digitalica commented 5 years ago

i think 1 and 2 are correct. The mode-s-decode project also checks them, in index.js line 200.

1/2 are ground speed (speed over ground) for sub- and supersonic aircraft. Some docs make it look like this speed when on ground / not airbone. In practice it looks like the speed is reported when airborne, showing the ground speed. (so i'd say: not crazy ;-) ) 2/3 are airspeed (speed through air, will be higher in case of headwind, lower in case of tailwind)