How ouster-lidar/ouster-sdk works
Project type and purpose
• This is an open‑source SDK/toolkit (C++ and Python) for Ouster LiDAR sensors. It provides:
• A C++ client library (ouster_client) to connect, configure, and read data from sensors over the network.
• A C++ PCAP module (ouster_pcap) to record/replay sensor UDP packets.
• A C++ OSF module (ouster_osf) to store and retrieve LiDAR data in the Ouster‑specific OSF file format.
• A C++ visualization library (ouster_viz) for rendering point clouds.
• A Python SDK (python/) that wraps the C++ libraries, provides a CLI, high‑level APIs, and example scripts.
• Build system glue (CMake, Docker, CI scripts), documentation (docs/), and tests.
File structure
• Top‑level CMakeLists.txt and related cmake/ files define a multi‑target build.
• Directories:
• ouster_client/ (C++ core networking and data structures)
• ouster_pcap/ (C++ packet capture and replay)
• ouster_osf/ (C++ OSF file encoder/decoder plus flatbuffers definitions)
• ouster_viz/ (C++ OpenGL-based point-cloud rendering)
• python/ (bindings via pybind11, CLI plugin architecture, Python SDK subpackages)
• examples/ (C++ example clients demonstrating linking and usage)
• docs/ (Sphinx-based C++ and Python API references, tutorials)
• thirdparty/ (jsoncons, spdlog, glad, etc.) for logging, JSON, GL support.
• .github/, Jenkinsfile, Dockerfiles, vcpkg.json for CI/CD, linting, packaging.
README for additional insights
• Confirms the above modules.
• Notes that ROS driver is external.
• Emphasizes cross‑platform support, C++/Python interoperability, and modular subcomponents.
a. Main components:
• External LiDAR Sensor Hardware
• Network Transport (UDP)
• C++ Core Libraries:
– ouster_client (sensor communication & parsing)
– ouster_pcap (pcap I/O)
– ouster_osf (file I/O via OSF FlatBuffers)
– ouster_viz (point-cloud renderer)
• Python Layer (pybind11 bindings + CLI framework + high‑level SDK)
• Examples & CLI (Python scripts & C++ binaries)
• Third‑party components (jsoncons, spdlog, GLFW/glad)
• Build & CI (CMake, Docker, GitHub Actions, Jenkins)
b. Relationships & data flows:
1. Sensor → UDP → ouster_client → LidarScan objects
2. ouster_client outputs feed into:
– live visualization (ouster_viz)
– offline capture (ouster_pcap → .pcap files)
– OSF writer (ouster_osf → .osf files)
3. Python layer wraps all C++ modules and exposes:
– CLI commands (plugins under python/src/ouster/cli/plugins/)
– Python SDK APIs (python/src/ouster/sdk/…)
4. Examples & tests import/use either C++ binaries or Python APIs.
c. Architectural patterns & principles:
– Modular, layer‑based design: transport, parsing, storage, visualization.
– Plugin architecture (Python CLI) for extensibility.
– CMake multi‑project build, pybind11 for language bindings.
– Use of FlatBuffers for binary file schema (OSF), PCAP for raw packet storage.
d. Key technologies:
– C++17, pybind11, FlatBuffers, JSONCons, spdlog, GLFW/OpenGL for rendering.
– CMake, Docker, GitHub Actions for build/test.