Serial communication protocol for the Ping and other Blue Robotics products.
Byte | Type | Name | Value | |
---|---|---|---|---|
0 | uint8_t | start_byte_1 | "B" | |
1 | uint8_t | start_byte_2 | "R" | |
2-3 | uint16_t | length | payload length in bytes (could be 0) | |
4-5 | uint16_t | message_id | Message identifier | |
6 | uint8_t | src_device_id | Ping device ignores packet unless: 1. dst_device_id == Ping's device ID, | |
7 | uint8_t | dst_device_id | or 2. dst_device_id == 0xff (broadcast), or 3. src_device_id == 0 && dst_device_id == 0 (legacy) | |
8-n | message specific | payload | bag of bytes. meaning depends on message | |
(n+1)-(n+2) | uint16_t | checksum | (sum bytes 0-n) & 0xffff |
Sends a device into bootloader mode for flashing firmware updates.
Gets information about the device and firmware version.
Type | Name | Value |
---|---|---|
u8 | device_type | 0=unknown, 1=echosounder, 2=mechanical scanning |
u8 | device_model | See future table of models for each deviceType category (1=Ping) |
u16 | fw_version_major | Major firmware version number |
u16 | fw_version_minor | Minor firmware version number |
Reboots the device.
Sets the ID of a device. Request this message from device 255 to get the address of all of the connected devices. Useful for recovery a lost device ID.
Type | Name | Value |
---|---|---|
u8 | ID | 1-254 are valid values (default value is 1) |
Useful for determining when a device has a new reading available.
Type | Name | Value |
---|---|---|
u8 | is_new_data | 0=no new data available, 1=new data available since last call to "gen_new_data" |
Request a message from a device.
Type | Name | Value |
---|---|---|
u16 | request_id | Message ID requested |
Set the speed of sound in your application.
Type | Name | Value |
---|---|---|
u32 | c_water | Speed of sound in water - mm/sec (1,500,000 is default) |
Just returns the distance and confidence without extra metadata.
Type | Name | Value |
---|---|---|
u32 | distance | Measured range mm |
u8 | confidence | confidence of smoothed range, 0-100 (% of recent readings that were not outliers) |
Full distance message including metadata.
Type | Name | Value |
---|---|---|
u32 | distance | Measured range mm |
u8 | confidence | confidence of smoothed range, 0-100 (% of recent readings that were not outliers) |
u16 | pulse_usec | Pulse length in µs |
u32 | ping number | counts the pings since power up |
u32 | start_mm | start range of returned profile |
u32 | length_mm | end_mm = start_mm + length_mm |
u32 | gain_index | Analog gain index |
Full sonar profile data.
Type | Name | Value |
---|---|---|
u32 | distance | mm |
u8 | confidence | Percent confidence, 0-100 |
u16 | pulse_usec | Pulse length in µs |
u32 | ping number | counts the pings since power up |
u32 | start_mm | start range of returned profile |
u32 | length_mm | end_mm = start_mm + length_mm |
u32 | gain_index | Analog gain index |
u16 | num_points | Number of data points returned Note: Fixed at 200 |
u8 [num_points] | data | Echo data array |
The range that an echosounder is scanning in.
Type | Name | Value |
---|---|---|
u32 | start_mm | |
u32 | length_mm |
The mode setting for echosounders. Automatic or Manual.
Type | Name | Value |
---|---|---|
u8 | auto_manual | 1=auto, 0=manual |
The rate that an echosounder is scanning at.
Type | Name | Value |
---|---|---|
u16 | msec_per_ping | 0=disable continuous ping, otherwise min msec_per_ping = 100 (10 pings/sec) |
The sensitivity of the receiving transducer.
Type | Name | Value |
---|---|---|
u32 | gain_index | 0-8 are valid settings |
The length of the emitted pulse in echosounders.
Type | Name | Value |
---|---|---|
u16 | pulse_usec | Device specific (in microseconds) |
The supply voltage, in millivolts.
Type | Name | Value |
---|---|---|
u16 | voltage | 0 - 65535 (5000 nominal) |
Returns the response data for a single angle.
Type | Name | Value |
---|---|---|
u16 | angle | Head angle in centidegrees (359 degrees = 35900) |
u16 | pulse_usec | Pulse length in µs |
u32 | range_mm | Range of returned profile |
u32 | gain_index | Analog gain index (device specific) |
u16 | num_points | Number of data points returned |
u8[num_points] | data | Response data |
The range that the scanning sonar is scanning in.
Type | Name | Value |
---|---|---|
u32 | range_mm |
The mode setting for the sonar. Automatic or Manual.
Type | Name | Value |
---|---|---|
u8 | auto_manual | 1=auto, 0=manual |
The sensitivity of the receiving transducer.
Type | Name | Value |
---|---|---|
u32 | gain_index | Device specific gain setting |
Configures the desired sector for scanning.
Type | Name | Value |
---|---|---|
i16 | train_angle | -18000 to 18000 centidegrees |
u16 | sector_width | 0 to 36000 centidegrees |
u8 | step_size | Step size index (device specific) |
u16 | pulse_usec | Pulse length in µs |
u16 | sample_size | Number of data points to return (0 for auto) |