|
waterlinkedsonar
C++ client library for the Water Linked Sonar 3D-15
|
Namespaces | |
| namespace | rip |
Classes | |
| struct | About |
| Device identity from GET /about. More... | |
| struct | BitmapImageView |
| 8-bit greyscale image, displayable without further processing. More... | |
| class | CurlTransport |
| libcurl easy-interface transport: one handle, blocking, not thread-safe. More... | |
| class | ForceSyncOngoingError |
| force_sync_ntp() while another force-sync is running; the device answers HTTP 409. More... | |
| struct | ForceSyncResult |
| Outcome of a forced NTP sync. More... | |
| class | HttpError |
| Transport failure or non-2xx HTTP response. More... | |
| class | HttpTransport |
| Blocking HTTP transport. More... | |
| struct | ImuBatchView |
| Batch of approximately 100 Hz IMU samples sent while acoustics is enabled. More... | |
| struct | MessageHeader |
| Per-shot metadata shared by image message types. More... | |
| class | ProtocolError |
| Device answered with a body the client cannot interpret. More... | |
| struct | Range |
| Imaging range limits in meters. More... | |
| struct | RangeImageView |
| Per-pixel distance to the strongest reflection. More... | |
| class | Receiver |
| Owns the receive thread: reads datagrams from the injected socket, decodes them, and dispatches to the registered callbacks on that thread. More... | |
| struct | ReceiverOptions |
| Datagram filtering applied before decoding. More... | |
| struct | ReceiverStats |
| Snapshot of the receive thread's counters, cumulative since start(). More... | |
| class | SonarClient |
| Client for the Sonar 3D-15 integration API. More... | |
| struct | Status |
| Subsystem health from GET /status. More... | |
| struct | StatusEntry |
| One subsystem's health from GET /status. More... | |
| class | TimeAlreadySynchronizedError |
| set_time_manual() while the device is already NTP-synchronized; the device answers HTTP 409. More... | |
| struct | TimeStatus |
| Device clock state from GET /time/status. More... | |
| struct | UdpConfig |
| How the sonar streams data, from GET/POST /udp. More... | |
| class | UdpSocket |
| Receive-only UDP socket for the sonar's data stream. More... | |
| struct | UdpSocketConfig |
| Socket setup for the sonar's data stream. More... | |
| class | VersionError |
| Device firmware is older than the endpoint requires. More... | |
Typedefs | |
| template<typename T > | |
| using | Span = tcb::span< T > |
| Non-owning view over a contiguous sequence. | |
Enumerations | |
| enum class | BitmapImageType : std::uint8_t { SIGNAL_STRENGTH , SHADED } |
| What a BitmapImageView shows. More... | |
| enum class | AcousticsMode : std::uint8_t { LOW_FREQUENCY , HIGH_FREQUENCY } |
| Imaging mode: low frequency gives a 90x40 degree field of view at 5 Hz, high frequency 40x40 degrees at 20 Hz. More... | |
| enum class | Salinity : std::uint8_t { SALT , FRESH } |
| Water salinity, used by the sonar's automatic speed of sound. More... | |
Functions | |
| bool | range_image_to_distances (const RangeImageView &img, std::vector< float > &out) |
| Converts a range image to per-pixel distances. | |
| bool | range_image_to_points (const RangeImageView &img, std::vector< float > &out, bool organized) |
| Converts a range image to XYZ float32 triples using the pixel-to-angle mapping from the Water Linked docs: | |
| bool | bitmap_to_strength_linear (const BitmapImageView &img, std::vector< std::uint16_t > &out) |
| Recovers linear 15-bit signal strength from a SIGNAL_STRENGTH bitmap, inverting the device's logarithmic mapping: pixel = 100 * log10(linear / 30). | |
| std::optional< std::chrono::system_clock::time_point > | sntp_query (const std::string &server, std::chrono::milliseconds timeout, std::uint16_t port=123) |
| Asks an NTP server for its current time with a single SNTP (RFC 4330) query. | |
| const char * | to_string (AcousticsMode mode) |
| Name used on the wire by the HTTP API: "low-frequency" or "high-frequency". | |
| const char * | to_string (Salinity salinity) |
| Name used on the wire by the HTTP API: "salt" or "fresh". | |
| const char * | to_string (UdpConfig::Mode mode) |
| Name used on the wire by the HTTP API: "multicast", "unicast" or "disabled". | |
Variables | |
| constexpr const char * | DEFAULT_IP = "192.168.194.96" |
| Factory default IP address of the sonar. | |
| constexpr const char * | MULTICAST_GROUP = "224.0.0.96" |
| Multicast group address for sonar data streams. | |
| constexpr std::uint16_t | MULTICAST_PORT = 4747 |
| Multicast port for sonar data streams. | |
| constexpr std::size_t | MAX_DATAGRAM_SIZE = 65507 |
| Largest UDP payload the sonar can send; receive buffers are sized to it. | |
| using waterlinked::sonar::Span = typedef tcb::span<T> |
Non-owning view over a contiguous sequence.
API-compatible with C++20 std::span. Aliases the vendored tcb::span under every language standard so the library and its consumers agree on the type regardless of the standard each is compiled with.
|
strong |
|
strong |
What a BitmapImageView shows.
|
strong |
| bool waterlinked::sonar::bitmap_to_strength_linear | ( | const BitmapImageView & | img, |
| std::vector< std::uint16_t > & | out | ||
| ) |
Recovers linear 15-bit signal strength from a SIGNAL_STRENGTH bitmap, inverting the device's logarithmic mapping: pixel = 100 * log10(linear / 30).
| img | Image to convert. |
| out | Resized to width * height; 0 where the pixel has no data. |
| bool waterlinked::sonar::range_image_to_distances | ( | const RangeImageView & | img, |
| std::vector< float > & | out | ||
| ) |
Converts a range image to per-pixel distances.
| img | Image to convert. |
| out | Resized to width * height; out[i] = pixel[i] * image_pixel_scale in meters, 0.0 where the pixel has no data. |
| bool waterlinked::sonar::range_image_to_points | ( | const RangeImageView & | img, |
| std::vector< float > & | out, | ||
| bool | organized | ||
| ) |
Converts a range image to XYZ float32 triples using the pixel-to-angle mapping from the Water Linked docs:
| img | Image to convert. |
| out | Organized: width * height triples in row-major pixel order, NaN for pixels with no data. Unorganized: one triple per valid pixel. |
| organized | Selects the output layout. |
| std::optional< std::chrono::system_clock::time_point > waterlinked::sonar::sntp_query | ( | const std::string & | server, |
| std::chrono::milliseconds | timeout, | ||
| std::uint16_t | port = 123 |
||
| ) |
Asks an NTP server for its current time with a single SNTP (RFC 4330) query.
Intended as a pre-flight check of a time source before configuring it on a device, not as a time synchronization mechanism.
| server | Hostname or IP address. |
| timeout | Maximum wait for the response. |
| port | NTP port. |
| const char * waterlinked::sonar::to_string | ( | AcousticsMode | mode | ) |
Name used on the wire by the HTTP API: "low-frequency" or "high-frequency".
| const char * waterlinked::sonar::to_string | ( | Salinity | salinity | ) |
Name used on the wire by the HTTP API: "salt" or "fresh".
| const char * waterlinked::sonar::to_string | ( | UdpConfig::Mode | mode | ) |
Name used on the wire by the HTTP API: "multicast", "unicast" or "disabled".
|
inlineconstexpr |
Factory default IP address of the sonar.
|
inlineconstexpr |
Largest UDP payload the sonar can send; receive buffers are sized to it.
|
inlineconstexpr |
Multicast group address for sonar data streams.
|
inlineconstexpr |
Multicast port for sonar data streams.