Advanced - Kauai Labs navX2-MXP User Manual

Robotics navigation sensor
Table of Contents

Advertisement

Advanced

Serial Protocol
In order to communicate sensor data to a client (e.g., a RoboRio robot controller) the navX-sensor
software uses a custom protocol. This protocol defines messages sent between the navX-sensor and the
client over a serial interface, and includes an error detection capability to ensure corrupted data is not
used by the client.
The navX-sensor Serial protocol uses two message types, the legacy ASCII messages initially introduced
in the nav6 sensor, and the modern binary messages introduced in the navX-sensor.
Source code that implements the navX-sensor ASCII and binary protocols in
to simplify adding support for the navX-sensor protocol to a software project.
Message Structure
ASCII Protocol Messages
Each navX-sensor Serial ASCII protocol message has the following structure:
Start of Message
1 byte
Binary Protocol Messages
Each navX-sensor Serial Binary protocol message has the following structure:
Start of Message Binary Message
Indicator
1 byte
1 byte
Data Type Encoding (ASCII)
Base16 encoding is used for ASCII message elements, as follows:
Data Type
Float
8-bit Integer
16-bit Integer
Advanced
Serial Protocol
Message ID
1 byte
Binary Message
Length
1 byte
Encoding
(Sign)(100s)(10s)(1s).(10ths)(100t
hs)
(HighNibble)(LowNibble)
(HighByte,HighNibble)(HighByte,
LowNibble)(LowByte,HighNibble
Message Body
length is message-type
dependent
Message ID
Message Body
1 byte
length is message-
type dependent
Example
'-132.96'. ' 257.38'
'E9'
'1A0F'
Java
and
C++
are provided
Message Termination
4 bytes
Message
Termination
4 bytes
80

Advertisement

Table of Contents
loading

Related Products for Kauai Labs navX2-MXP

Table of Contents