ADSBDecoder {openSkies}R Documentation

An object of class adsbDecoder object representing a decoder used to decode ADS-B v2 messages

Description

R6Class object of class adsbDecoder representing a decoder used to decode ADS-B v2 messages. Provides methods for decoding a single message or a batch. Additionally, it includes methods for transforming hex strings into bits vectors and decoding some individual fields. Decoded messages are returned as lists with each decoded field.

Usage

ADSBDecoder

Fields

lastOddPosition

Last ground or airborne position message decoded with decodeGroundPositionMessage or decodeAirbornePositionMessage

lastEvenPosition

Last ground or airborne position message decoded with decodeGroundPositionMessage or decodeAirbornePositionMessage

Methods

hexToBits(hex)

Transform a hexadecimal string into its corresponding bits representation, with higher bits in the first positions.

,

decodeCPR(cprLatEven, cprLonEven, cprLatOdd, cprLonOdd, isAirborne=TRUE)

Decodes a pair of CPR-encoded positions given as longitudes and latitudes, corresponding to a pair of even and odd messages, obtaining the actual positions for both. The isAirborne argument indicates whether or not the CPR-encoded positions correspond to isAirborne position messages or not (ground position messages). The result is given as a vector with the decoded positions for both the even and odd messages, in the following order: even latitude, even longitude, odd latitude, odd longitude.

,

decodeMessage(message)

Decodes a single ADS-B v2 message in the form of a bits vector (higher bits in the first positions). The last even and odd positional messages are cached to decode following positional messages. The following message types are supported: aircraft identification, airborne position, ground position, airborne velocity, and operation status.

,

decodeMessages(messages)

Decodes several ADS-B v2 messages in the form of a list of bits vector (higher bits in the first positions). The following message types are supported: aircraft identification, airborne position, ground position, airborne velocity, and operation status.

Examples


# Decode three messages, using both individual decoding and batch decoding. 
# The two first messages contain the airborne position.
# The third one, the aircraft identification

msg0 <- ADSBDecoder$hexToBits("8D40621D58C386435CC412692AD6")
msg1 <- ADSBDecoder$hexToBits("8D40621D58C382D690C8AC2863A7")
msg2 <- ADSBDecoder$hexToBits("8D4840D6202CC371C32CE0576098")

decoded0 <- ADSBDecoder$decodeMessage(msg0)
decoded1 <- ADSBDecoder$decodeMessage(msg1)
decoded2 <- ADSBDecoder$decodeMessage(msg2)

decodedAll <- ADSBDecoder$decodeMessages(list(msg0, msg1, msg2))

[Package openSkies version 1.2.1 Index]