waterlinkedsonar
C++ client library for the Water Linked Sonar 3D-15
Loading...
Searching...
No Matches
waterlinkedsonar

CI Docs Release [License](LICENSE)

C++17 client library for the Water Linked Sonar 3D-15.

  • Configuration over the sonar's HTTP API: acoustics, imaging range and mode, salinity, speed of sound, UDP output, time and NTP.
  • UDP receiver that decodes the Range Image Protocol (RIP2) stream (range images, signal-strength images, IMU batches) and dispatches them to callbacks.
  • Conversions from range images to per-pixel distances and XYZ point clouds.

Requires sonar firmware 1.5.1 or newer.

Build

sudo apt-get install cmake g++ libcurl4-openssl-dev libsnappy-dev zlib1g-dev \
nlohmann-json3-dev libprotobuf-dev protobuf-compiler libgtest-dev
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
ctest --test-dir build
sudo cmake --install build

-DBUILD_TESTING=OFF and -DWATERLINKEDSONAR_BUILD_EXAMPLES=OFF skip the tests and the examples.

Use in your project

find_package(waterlinkedsonar REQUIRED)
target_link_libraries(your_target PRIVATE waterlinkedsonar::waterlinkedsonar)

The package also builds with colcon.

Usage

Complete programs are in examples/; the API reference is at bumblebeeas.github.io/waterlinkedsonar.

Configure the sonar

waterlinked::sonar::SonarClient client("192.168.194.96");
client.set_range({0.5, 10.0});
client.set_acoustics_enabled(true);
Client for the Sonar 3D-15 integration API.
Definition client.hpp:23
Client for the Sonar 3D-15 HTTP API.

Receive data

using namespace waterlinked::sonar;
Receiver receiver(std::make_unique<UdpSocket>(UdpSocketConfig{}));
std::vector<float> points;
receiver.on_range_image([&](const RangeImageView& img) {
// Runs on the receiver's thread.
range_image_to_points(img, points, /*organized=*/false);
});
receiver.start();
Owns the receive thread: reads datagrams from the injected socket, decodes them, and dispatches to th...
Definition receiver.hpp:56
Conversions from range images to distances and point clouds, and from signal-strength images to linea...
Definition client.hpp:14
Receive thread that decodes sonar datagrams and dispatches callbacks.
Per-pixel distance to the strongest reflection.
Definition messages.hpp:29
Socket setup for the sonar's data stream.
Definition udp_socket.hpp:17

Callback views are valid only for the duration of the callback; copy any data you keep.

Attribution

The protocol definition (proto/WaterLinkedSonarIntegrationProtocol.proto) and the test recording (test/data/ship_short.sonar) are taken from Water Linked's wlsonar Python client (MIT, Copyright Water Linked).

include/waterlinkedsonar/detail/tcb_span.hpp is Tristan Brindle's span implementation (Boost Software License 1.0).

License

MIT. See [LICENSE](LICENSE).