Skip to content

Repository files navigation

waterlinkedsonar

CI Docs Release 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

#include <waterlinkedsonar/client.hpp>

waterlinked::sonar::SonarClient client("192.168.194.96");
client.set_range({0.5, 10.0});
client.set_acoustics_enabled(true);

Receive data

#include <waterlinkedsonar/conversions.hpp>
#include <waterlinkedsonar/receiver.hpp>

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();

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.

About

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

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages