SeRoSystems / lib1090

Java decoding library for Mode S, ADS-B, TIS-B and ADS-R
GNU General Public License v3.0
16 stars 2 forks source link

My position info is always null . Why? #25

Open MacJayLee opened 18 hours ago

MacJayLee commented 18 hours ago

Hi ! Show you the code

1732869681309

My raw msg is “8d4ca513587153a8184a2fb5adeb”

The resolved msg is " Extended Squitter Airborne position (barometric altitude)\n Address: 4ca513 (Mode S / ADS-B)\n Air/Ground: airborne\n Altitude: 21525 ft barometric\n CPR type: Airborne\n CPR odd flag: even\n CPR latitude: (119820)\n CPR longitude: (18991)\n"

But c0 is always null . Where is my problem? Could you please help me? Thanks anyway

fixje commented 17 hours ago

I'm not sure what you are doing, but it seems that you want to extract a position from a single ADS-B position report. As stated in your screenshot, the CPR algorithm needs at least two ADS-B position reports to decode latitude and longitude.

Check out this excellent book to see how it works: https://mode-s.org/decode/content/ads-b/3-airborne-position.html

MacJayLee commented 16 hours ago

I'm not sure what you are doing, but it seems that you want to extract a position from a single ADS-B position report. As stated in your screenshot, the CPR algorithm needs at least two ADS-B position reports to decode latitude and longitude.

Check out this excellent book to see how it works: https://mode-s.org/decode/content/ads-b/3-airborne-position.html

You are right , I try to extract from single msg , but if there were two msg , how can I judge the relationship of them? I mean if one of them is even , and ohter is odd ,but I am not sure that they are a pair . Could you please give me an example about raw report and code?

fixje commented 15 hours ago

Check out our ExampleDecoder