Skip to main content

Tag Protocol

This tutorial is aimed at developers who use tag-based navigation, such as robots, drones, terminal navigation devices, etc. This interface can be used to obtain tag UID, coordinates, accuracy indicators and other information. The communication format is hexadecimal, and the interfaces include UART, IIC, etc.

Overview

Users can obtain positioning results through UART, IIC or other interfaces.

UART

In serial port mode, when the tag is able to calculate the current position, it will actively output a data frame containing MSG_Location_Result at the positioning frequency, and MSG_Location_Result contains the positioning result.

For more details, please refer to uBeacon_Tag_UART_Protocol.pdf.

IIC

In IIC mode, the tag acts as a slave and requires the host to actively obtain the positioning result. The positioning result is stored in the Location_Result register at address 0x44.

For more details, please refer to uBeacon_Tag_IIC_Protocol.pdf.

SPI

Stay tuned.

Data Analysis

Positioning Results

The tag data is output in little-endian mode.

The positioning results obtained by any interface can be represented by the following structure.

struct LocationResult {
uint64_t local_time; //tag local time, unit:us
float pos[3]; //3 axis position (x,y,z), unit:m
int16_t vel[3]; //3 axis velocity (x,y,z), scaling factor 100, unit:m/s
uint8_t pos_noise[3]; //3 axis position noise (x,y,z), scaling factor 100, unit:m
uint8_t vel_noise[3]; //3 axis velocity noise (x,y,z), scaling factor 100, unit:m/s
};

Parsing Example

The data obtained through UART and IIC is stored in hexadecimal. In order to observe the positioning information more intuitively, it needs to be converted into decimal. Please refer to the following analysis example.

Hexadecimal data: B5 23 0B 02 00 00 00 00 DD 51 b1 41 EB 58 57 41 AA E7 9A 3F FA FF 04 00 00 00 07 07 04 08 08 04。

local_time:

The hexadecimal value 0x00000000020B23B5 is converted to decimal value 34284469. The local time is 34284469us from the time of power-on.

pos:

The x-axis position hexadecimal 0x41b151DD is converted to decimal 22.164972, and the x-axis coordinate is 22.164972m.

The hexadecimal y-axis position 0x415758EB is converted to decimal 13.459208, and the y-axis coordinate is 13.459208m.

The z-axis position hexadecimal 0x3F9AE7AA is converted to decimal 1.210195, and the z-axis coordinate is 1.210195m.

vel:

The x-axis speed hexadecimal 0xFFFA is converted to decimal -6 and divided by the scale factor 100. The x-axis speed is -0.06m/s.

The y-axis speed hexadecimal 0x0004 is converted to decimal 4 and divided by the scaling factor 100. The y-axis speed is 0.04m/s.

The z-axis speed hexadecimal 0x0000 is converted to decimal 0 and divided by the scaling factor 100. The z-axis speed is 0m/s.

pos_noise:

The x-axis position noise hexadecimal 0x07 is converted to decimal 7 and divided by the scale factor 100. The x-axis position noise is 0.07m.

The y-axis position noise hexadecimal 0x07 is converted to decimal 7 and divided by the scale factor 100. The y-axis position noise is 0.07m.

The z-axis position noise hexadecimal 0x04 is converted to decimal 4 and divided by the scale factor 100. The z-axis position noise is 0.04m.

vel_noise:

The x-axis velocity noise hexadecimal 0x08 is converted to decimal 8 and divided by the scaling factor 100. The x-axis velocity noise is 0.08m/s.

The y-axis velocity noise hexadecimal 0x08 is converted to decimal 8 and divided by the scaling factor 100. The y-axis velocity noise is 0.08m/s.

The z-axis velocity noise hexadecimal 0x04 is converted to decimal 4 and divided by the scale factor 100. The z-axis velocity noise is 0.04m/s.

Parameter Configuration

Users can configure parameters to achieve the desired positioning effect.

For more details, please refer to uBeacon_Tag_UART_Protocol.pdf.