ROS2Sonic  0.2.0
A ROS2 driver for R2Sonic MBES
Loading...
Searching...
No Matches
r2sonic::packets::AID0 Class Reference

An interpreter class that represents the Acoustic Image (AID) packet. More...

#include <aid0.hpp>

Inheritance diagram for r2sonic::packets::AID0:
Collaboration diagram for r2sonic::packets::AID0:

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::MiniHeaderminiHeader () 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
 

Detailed Description

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

Note
Some packets are optional. See the member function defitions for details

Member Function Documentation

◆ a1()

sections::A1 r2sonic::packets::AID0::a1 ( ) const
inline

Gets the OPTIONAL (once per ping) sections::A1 Section associated with the AID0 packet.

Note
This section is OPTIONAL and is only present for the first packet for any given ping
Returns
The Packet's sections::A1 Section;

◆ getPingNo()

u32 r2sonic::packets::AID0::getPingNo ( ) const
inline

Finds the ping number associated with the packet.

Note
This gets the ping number from either the H0 section or the m0 section depending on which is included in the packet.
Returns
the ping number of the packet

◆ h0()

sections::H0 r2sonic::packets::AID0::h0 ( ) const
inline

Gets the OPTIONAL (once per ping) sections::H0 Section associated with the AID0 packet.

Note
This section is OPTIONAL and is only present for the first packet for any given ping
Returns
The Packet's sections::H0 Section;

◆ isFirstInSeries()

bool r2sonic::packets::AID0::isFirstInSeries ( ) const
inline

Determines if this is the first packet in a the series for a given ping.

Returns
true if this is the first packet in the series

◆ m0()

sections::M0 r2sonic::packets::AID0::m0 ( ) const
inline

Gets the OPTIONAL sections::M0 Section associated with the AID0 packet.

Note
This section is OPTIONAL and is NOT present for the first packet for any given ping
Returns
The Packet's sections::M0 Section;

◆ nominalType()

char * r2sonic::packets::AID0::nominalType ( ) const
inlineprotectedvirtual

◆ Packet()

r2sonic::packets::Packet::Packet ( char * start_bit)
inline

Constructor.

Parameters
thestart bit of the datagram you want to read

The documentation for this class was generated from the following file: