Skip to content
Snippets Groups Projects
user avatar
Adrien van den Bossche authored
06e7d93a
History
Name Last commit Last update
arduino/Locapack
README.md

locapack

Brief

Another localisation packet protocol to send/receive localisation data over networks.

Implementation

Arduino

License

Locapack is distributed under the GPLv3 license. Please refer to the LICENSE file.

Packet structure details

Message endianness is little endian.

Packet general structure

2B 2B 0/5B 1B (opt) variable 1B variable
header sequence_number timestamp movement_id device_id payload_len payload

The sequence_number field is mandatory.

The timestamp field is optional and its presence is announced in the header. The timestamp field contains the number of milliseconds since the boot of the local system. There is no synchronisation between different nodes.

The movement_id field is optional and its presence is announced in the header.

The device_id field length is annouced in the header. A length of 0 means that the field is not present in the packet, for example if the device_id is the same as the source address of the packet.

The payload_len field contains the length of the payload.

The payload length depends on the packet_type annouced in the header.

Header structure

MSB 4b 4b 4b 1b 1b 2b LSB
protocol_version device_id_size packet_type movement_id_presence_flag timestamp_presence_flag reserved

The protocol_version field indicates the version of the localisation packet used. This documentation describes the version #1 of the localisation packet protocol.

The device_id_size indicates the number of Bytes of the device_id field. A length of 0 means that no device_id is present in the packet.

The packet_type indicates the structure of the payload. These types of packet have been described:

  • type 0 : Universal GNSS localisation
  • type 1 : Locally referenced localisation
  • type 2 : Inter-node proximity

The movement_id_presence_flag must be set to 1 if the movement_id field is present in the packet.

The timestamp_presence_flag must be set to 1 if the timestamp field is present in the packet.

Payload structure by packet type

Type 0 : Universal GNSS localisation

Transport of GNSS coordinates. Altitude and DOP are optionnal.

Payload general structure
1B 4B 4B 0/4B 0/4B
header latitude longitude altitude dop

The latitude field is a C-type float and is mandatory.

The longitude field is a C-type float and is mandatory

The altitude field is a C-type float and its presence is annouced in the header

The dop field is a C-type float and its presence is annouced in the header

Header
1b 1b 6b
altitude_presence_flag dop_presence_flag reserved

The altitude_presence_flag must be set to 1 if the altitude field is present in the packet.

The dop_presence_flag must be set to 1 if the dop field is present in the packet.

Type 1 : Locally referenced localisation

Transport of locally referenced 2D or 3D localisation. The "repère" is identified by an UID.

Payload general structure
1B 4B 4B 0/4B 0/4B 0/8B
header x y z dop repere_id

The x field is a C-type float and is mandatory.

The y field is a C-type float and is mandatory

The z field is a C-type float and its presence is annouced in the header

The dop field is a C-type float and its presence is annouced in the header

The repere_id field is a 64-bit UID and its presence is annouced in the header

Header
1b 1b 1b 5b
z_presence_flag dop_presence_flag repere_id_presence_flag reserved

The z_presence_flag must be set to 1 if the z field is present in the packet (3D localisation).

The dop_presence_flag must be set to 1 if the dop field is present in the packet.

The repere_id_presence_flag must be set to 1 if the repere_id field is present in the packet.

Type 2 : Inter-node proximity

Transport of raw distances (rangings) between pairs of nodes. The ranging technology can be specified.