Payload | ||||
Sub-Payload 0 | Sub-Payload 1 | Sub-Payload 2 | ... | Sub-Payload N-1 |
Serialization is the process of converting a data structure into a bytestream. Deserialization is reversal process. Each data types are serialized and deserialized by <a href="http://en.wikipedia.org/wiki/Least_significant_byte">LSB</a>-First Order
. It means Least Significant Bytes will comes first on the bytestream. For example, The integer number 2,864,434,397(0xAABBCCDD) can be serialized into:
0xDD | 0xCC | 0xBB | 0xAA |
So, 0xDD will arrive first in bytestream.
Here are template functions to handle it on kobuki_deriver, buildVariable() and buildBytes().
, where is frequency of sound in Hz, and is 0.00000275
Duration
1
Duration of playing note in milli-seconds
Name | Size | Value | Value in Hex | Description | |
---|---|---|---|---|---|
Header | Identifier | 1 | 12 | 0x0C | Fixed |
Length | Size of data field | 1 | 2 | 0x02 | Fixed |
Data | Digital output flags | 2 | Set the flags to set high on output pins of expansion port 0x0001 for digital output ch. 0 0x0002 for digital output ch. 1 0x0004 for digital output ch. 2 0x0008 for digital output ch. 3 Set the flags to turn on external powers 0x0010 for external power 3.3V ch. 0x0020 for external power 5V ch. 0x0040 for external power 12V/5A ch. 0x0080 for external power 12V/1.5A ch. Set the flags to turn on LEDs 0x0100 for red colour of LED1 0x0200 for green colour of LED1 0x0400 for red colour of LED2 0x0800 for green colour of LED2 |
Name | Size | Value | Value in Hex | Description | |
---|---|---|---|---|---|
Header | Feedback Identifier | 1 | 1 | 0x01 | Fixed |
Length | Size of data field | 1 | 15 | 0x0F | Fixed |
Data | Timestamp | 2 | Timestamp generated internally in milliseconds It circulates from 0 to 65535 | ||
Bumper | 1 | Flag will be setted when bumper is pressed 0x01 for right bumper 0x02 for central bumper 0x04 for left bumper | |||
Wheel drop | 1 | Flag will be setted when wheel is dropped 0x01 for right wheel 0x02 for left wheel | |||
Cliff | 1 | Flag will be setted when cliff is detected 0x01 for right cliff sensor 0x02 for central cliff sensor 0x04 for left cliff sensor | |||
Left encoder | 2 | Accumulated encoder data of left and right wheels in ticks Increments of this value means forward direction It circulates from 0 to 65535 | |||
Right encoder | 2 | ||||
Left PWM | 1 | PWM value that applied to left and right wheel motor This data should be converted signed type to represent correctly Negative sign indicates backward direction | |||
Right PWM | 1 | ||||
Button | 1 | Flag will be setted when button is pressed 0x01 for Button 0 0x02 for Button 1 0x04 for Button 2 | |||
Charger | 1 | 0 for DISCHARGING state 2 for DOCKING_CHARGED state 6 for DOCKING_CHARGING state 18 for ADAPTER_CHARGED state 22 for ADAPTER_CHARGING state | |||
Battery | 1 | Voltage of battery in 0.1 V Typically 16.7 V when fully charged | |||
Overcurrent flags | 1 | Flag will be setted when overcurrent is detected 0x01 for left wheel 0x02 for right wheel |
This value is related with distance between sensor and floor surface. See the datasheet for more detailed information.
This data also available in the Cliff field of enBasicSensorData , as a boolean type, processed on the kobuki.
Name | Size | Value | Value in Hex | Description | |
---|---|---|---|---|---|
Header | Identifier | 1 | 5 | 0x05 | Fixed |
Length | Size of data field | 1 | 6 | 0x06 | Fixed |
Data | Right cliff sensor | 2 | ADC output of each PSD Data range: 0 ~ 4095 (0 ~ 3.3V) Distance range: 2 ~ 15 cm Distance is not linear w.r.t. ADC output. See the datasheet for more detail. | ||
Central cliff sensor | 2 | ||||
Left cliff sensor | 2 |
Raw gyro data 0
x-axis
2
ADC output of each-axis in 0.00875 deg/s
y-axis
2
z-axis
2
:
:
Raw gyro data N-1
x-axis
2
y-axis
2
z-axis
2