ROS2Sonic
0.2.0
A ROS2 driver for R2Sonic MBES
|
An interpreter class that represents the Acoustic Image (AID) packet. More...
#include <aid0.hpp>
Public Member Functions | |
sections::H0 | h0 () const |
Gets the OPTIONAL (once per ping) sections::H0 Section associated with the AID0 packet. | |
sections::A1 | a1 () const |
Gets the OPTIONAL (once per ping) sections::A1 Section associated with the AID0 packet. | |
sections::M0 | m0 () const |
Gets the OPTIONAL sections::M0 Section associated with the AID0 packet. | |
bool | isFirstInSeries () const |
Determines if this is the first packet in a the series for a given ping. | |
u32 | getPingNo () const |
Finds the ping number associated with the packet. | |
Packet (char *start_bit) | |
Constructor. | |
Public Member Functions inherited from r2sonic::packets::Packet | |
Packet (char *start_bit) | |
Constructor. | |
const sections::MiniHeader * | miniHeader () const |
returns a pointer to the miniHeader | |
char * | startBit () const |
returns a pointer to the start bit used to define the packet | |
u16 | getSize () const |
gets the size of the entire DataFormat Packet reported by the MiniHeader | |
char * | end () const |
end returns a pointer to one bit beyond the current DataFormat Packet (the first bit of the next Packet) | |
char * | SectionsStartBit () const |
Returns the starting bit of the data sections of the packet (just after the mini header) | |
bool | isType () const |
Determines if the packet can be instantiated given the current data in the buffer. | |
Protected Member Functions | |
char * | nominalType () const |
Protected Member Functions inherited from r2sonic::packets::Packet | |
void | typeErrorCheck () const |
An interpreter class that represents the Acoustic Image (AID) packet.
This class has accessors which will return a pointer to each sub-section of the received packet.
R2Sonic's details on this packet type:
The acoustic image data contains real-time beamformer 8-bit magnitude data (beam amplitude) that has been scaled to 8-bits by a user-selected brightness value, and compressed in range by an adjustable amount to reduce network bandwidth and processing. The data is called "samples" before compression and "bins" after compression. For example, 7200 samples of beamformer data (M0_TotalSamples) may be compressed to 600 bins (M0_TotalBins). The number of beamformed data samples normally extends somewhat further than the user's range setting. The AIH0 sonar command sets an upper limit to the number of compressed output bins. It's not a precise compression factor, so the number of bins is usually somewhat less than the AIH0 value. The maximum data rate with no compression is about 17.5 megabytes per second (assuming 256 beams).
When the operator enables acoustic image mode, each sonar ping outputs numerous 'AID0' packets containing: one H0 header section, one A1 beam angle section, and many M0 data sections. The section order may change in the future, so plan for that in your data acquisition.
Each M0 section contains a subset of the ping data. Its header indicates its size position to help you assemble the full ping array.
You may wish to detect missing M0 data sections (perhaps a lost UDP packet), and then fill the gap with zeros or perhaps data from the previous ping (to reduce visual disturbances), and then increment an error counter for network health monitoring purposes.
The acoustic image data is basically in polar coordinates, so you may wish to geometrically warp it into the familiar wedge shape for display. Consider using OpenGL or Direct3D texture mapping
|
inline |
Gets the OPTIONAL (once per ping) sections::A1 Section associated with the AID0 packet.
|
inline |
Finds the ping number associated with the packet.
|
inline |
Gets the OPTIONAL (once per ping) sections::H0 Section associated with the AID0 packet.
|
inline |
Determines if this is the first packet in a the series for a given ping.
|
inline |
Gets the OPTIONAL sections::M0 Section associated with the AID0 packet.
|
inlineprotectedvirtual |
Implements r2sonic::packets::Packet.
|
inline |
Constructor.
the | start bit of the datagram you want to read |