openskynetwork / java-adsb

Mode S and ADS-B decoding library for Java
GNU General Public License v3.0
103 stars 41 forks source link

Note: a more elaborate and maintained branch of the library can be found here: https://github.com/SeRoSystems/lib1090

java-adsb

This is a Mode S and ADS-B decoding library for Java. It is a product of the OpenSky Network project (http://www.opensky-network.org). It is based on these two references:

It supports the following Mode S downlink formats:

The following ADS-B formats are supported:

The Comm-B registers, Comm-D data link and military ES are not parsed. Comm-B and D will follow at some point.

The formats are implemented according to RTCA DO-260B, i.e. ADS-B Version 2. The decoder properly takes care of older versions.

Packaging

This is a Maven project. You can simply generate a jar file with mvn package. All the output can afterwards be found in the target directory. There will be two jar files

Maven Central

We have also published this project on Maven Central. Just include the following dependency in your project:

<dependency>
  <groupId>org.opensky-network</groupId>
  <artifactId>libadsb</artifactId>
  <version>VERSION</version>
</dependency>

Get the latest version number here.

Usage

There are three different versions of ADS-B in the wild: 0, 1 and 2. Transmitters' ADS-B version affects interpretation of certain messages. This holds in particular for aircraft's operational status information such as position accuracy and system equipage.

When decoding ADS-B, a receiver by default assumes version 0, unless told otherwise. This has no effect on basic information such as position and velocity. These fields are compatible between different versions. However, for full awareness about an aircraft's capabilities, version information has to be taken into account. It is encoded in the operational status message which is sent around every five seconds. Thus, decoding ADS-B has to be done in a stateful manner. Libadsb includes a stateful decoder which can be found in the class ModeSDecoder. Given a stream of encoded messages, it returns decoded results of the inferred ADS-B version. This is represented by different types, e.g., AirbornePositionV0Msg and AirbornePositionV1Msg for versions 0 and 1.

We recommend having a look at the ExampleDecoder.java which gives a detailed explanation on how to use libadsb.

A demonstration how this decoder can be used is provided in OskySampleReader.java. It reads, decodes, and prints serialized ADS-B messages from avro-files with the OpenSky schema. A sample of such data and the schema is provided in the osky-sample repository.

Migration to Version 3

!!If you have been using libadsb version 2.x and earlier: Version 3 is not a drop-in replacement. You have to adapt your existing code!!

With libadsb version 3, many things have changed, including:

Migration Guide

General

Position Messages

Operational Status Messages

Velocity and Airspeed Messages

Long/Short ACAS