opendroneid / opendroneid-core-c

Open Drone ID Core C Library
Apache License 2.0
170 stars 64 forks source link

Just a question about encoding #59

Closed superBaik closed 1 year ago

superBaik commented 1 year ago

Hi There ! I am doing code review of opendroneid. Not an issue but I am just curious about the encoding parts. Before I review the source code, I thought the meaning of encoding was encryption of message. But in the source code about encoding was changing each data to ODID data frame such as compression.

I have a question at this point.

Thanks for reading my question, and hope you can give me any advice !

friissoren commented 1 year ago

One of the transmission methods is Bluetooth 4 Legacy Advertising. After the various header etc. data has been included, this transmission method supports only up to 25 bytes being transmitted in each message.

When the ASTM defined the messages and their bit/byte layout, it was therefore important to save any bytes that could be saved and it was decided to quantize (compress) some of the fields. E.g. all the altitude and speed related fields use this approach.

On the receiving side, those fields are then dequantized (decompressed) to bring back values that are close to the original ones.

If you look in the ASTM standard Table 7, there are more details on the exact method used.