Ouster SDK

repository·master·Indexed 19 days ago

https://github.com/ouster-lidar/ouster-sdk

A development toolkit for interacting with Ouster LiDAR sensors, featuring C++ and Python components. It includes the ouster-cli command line utility for sensor discovery, data visualization (viz), configuration, and processing of lidar data from sensors or files (PCAP/OSF). The SDK also integrates the robin-map header-only C++ library for high-performance hash maps.

Tokens
102.9K
Snippets
348
Records
518
Agent score
68%

What's inside ouster-sdk

  1. Overview of Ouster SDK components

    master

    The Ouster SDK is a cross-platform C++/Python toolkit for Ouster Lidar sensors. The repository is organized into several functional modules:

    • ouster_core: The core C++ library for the SDK.
    • ouster_algorithm: Shared perception and mapping algorithms.
    • ouster_pcap: C++ functions for handling pcap files related to Ouster sensors.
    • ouster_osf: C++ library for storing Ouster sensor data in the OSF format.
    • ouster_viz: A customizable point cloud visualizer.
    • python: The source code for the ouster-sdk Python package.
  2. Overview of the Ouster Python SDK

    master

    The Ouster Python SDK provides interfaces for interacting with Ouster sensor hardware. It is designed for prototyping and non-safety-critical applications.

    Core Capabilities:

    • Querying and setting sensor configuration.
    • Recording and reading data in pcap and Open Sensor Format (OSF).
    • Reliable reading and buffering of sensor UDP data streams.
    • Destaggering raw data into range, signal, near_ir, or reflectivity images.
    • Projecting range measurements to Cartesian (x, y, z) coordinates.
    • Visualization of multi-beam flash lidar data.
    • Mapping, Pose Optimization, Localization, and Zone monitoring.

    Python-Specific Features:

    • Frame-based access to lidar data as numpy datatypes.
    • A responsive visualizer utility for pcap files and live sensor data.
  3. Overview of Recording and Playback capabilities

    master

    The Ouster SDK provides tools to capture lidar data for reproducible testing, dataset sharing, or long-term logging. These utilities operate on the same abstractions used for live streams and include:

    • One-Command Capture: Record live sensors to OSF or PCAP formats while simultaneously saving metadata.
    • Deterministic Playback: Replay archived frames for regression tests and reproducibility.
    • Format Conversion: Translate captures into interchange formats like PLY, LAS, ROS bag, or CSV for downstream processing.
    • Granular Control: Trim, filter, or downsample datasets during playback without modifying the original raw files.
  4. Overview of SLAM capabilities in Ouster SDK

    master

    The Ouster SDK provides tools for Simultaneous Localization and Mapping (SLAM), allowing robots to construct maps of unknown environments while tracking their own location. The SDK supports both Python and C++ APIs for processing raw sensor packets and accumulating point clouds.

    Key Capabilities:

    • Real-time SLAM: Uses the SlamEngine class with a built-in Lidar Inertial Odometry (LIO) backend for incremental map generation and pose estimation.
    • Map-Based Localization: The LocalizationEngine enables real-time pose tracking against pre-built point cloud maps.
    • Motion Distortion Correction: Automatically corrects for motion distortion (deskewing). On firmware >= 3.2, it uses IMU-based deskewing; otherwise, it falls back to a constant-velocity model.
    • Multi-Sensor Synchronization: The ActiveTimeCorrection module handles unsynchronized or non-monotonic timestamps.
    • Offline Trajectory Optimization: The PoseOptimizer class refines trajectories post-processing using constraints like ABSOLUTE_POSE (loop closures, GPS fixes) and POINT_TO_POINT correspondences.
    • Flexible I/O: Supports live sensors, PCAP, and OSF files for input. Maps and trajectories can be exported as PLY, LAS, PCD, or OSF files.
  5. Overview of Ouster Perception [BETA]

    master

    The Ouster Perception API allows you to add detected objects (features derived from lidar data) to LidarFrame or FrameSet objects.

    Currently, the SDK provides a single DetectionEngine implementation that performs clustering on lidar data to produce Object instances. Future updates are expected to include object classification engines.

    Key Capabilities:

    • Cluster-based detection: Use the built-in DetectionEngine on live or recorded data.
    • OSF Persistence: Save frames, detected objects, and metadata into the Ouster Sensor Format (OSF) for offline workflows.
    • Metadata Management: Attach class maps and other metadata via FrameSetSourceMetadataSet.
    • Visualization: Inspect detections using the ouster-cli or the Python SimpleViz class.
  6. Overview of the Ouster OSF library

    master
    Ouster OSF (Ouster Sensor Format) is an extendable file format designed to efficiently store lidar sensor data, including sensor intrinsics and streaming capabilities. This library provides the tools necessary to read and process OSF files generated by Ouster tools, such as mapping software or the Ouster Data App.
  7. Overview of Sophus Lie Groups

    master

    Sophus is a C++ implementation of Lie groups used for 2D and 3D geometric problems in Computer Vision and Robotics. It provides implementations for:

    • SO(2) and SO(3): Special orthogonal groups for representing 2D and 3D rotations.
    • SE(2) and SE(3): Special Euclidean groups for representing 2D and 3D rigid body transformations (rotations and translations).

    For detailed API information, refer to the official Sophus API documentation.

  8. Key capabilities of the Localization feature

    master

    The Ouster SDK Localization feature provides several advanced capabilities for high-precision pose tracking:

    • Frame-to-Map Registration: Uses an ICP solver to estimate a precise rigid transformation for each frame against a pre-built map.
    • Motion Distortion Correction: Compensates for sensor motion during a frame. On firmware (FW) >= 3.2, it uses IMU data for high-fidelity correction; otherwise, it uses a constant velocity deskew model.
    • Multi-Sensor Support: Aggregates points from multiple sensors into a single frame before registration, increasing the field of view and robustness.
    • Per-Column Pose Output: Computes a unique SE(3) transform for every measurement column, allowing for sub-frame trajectory precision during high-speed motion.
    • Flexible Map Input: Supports loading maps directly in PLY or PCD formats.
    • Custom Solver Integration: Developers can use XYZLut to convert frames to Cartesian point clouds for custom solvers, then inject the resulting poses back into the frames.
  9. LidarFrame Processing Capabilities

    master

    The Ouster SDK provides a suite of utilities to transform raw lidar packets and frames into actionable data. Key processing capabilities include:

    • Destagger & Reproject: Converts staggered sensor data into organized range/intensity images and rectified XYZ point clouds.
    • Lookup Table Generation: Creates reusable XYZ/RGB lookup tables to accelerate coordinate transforms and visualization.
    • Field Masking & Filtering: Enables removing invalid returns, applying region-of-interest (ROI) masks, and downsampling frames.
    • Frame Composition: Facilitates merging multi-sensor frames, aligning timestamps, and aggregating frames for SLAM or mapping.
    • Batch & Offline Processing: Supports streaming frames from OSF or PCAP files with windowed/indexed access and parallel pipelines.
  10. Python SDK Examples Catalog

    master

    The Ouster Python SDK provides several categories of examples to help you work with sensor data, file formats, and visualization:

    Core Module Basics

    • Record and Replay Data: Connect to a sensor and record data to PCAP or OSF files.
    • Converting Data Formats: Work directly with the Ouster sensor.
    • Data Conversion: Convert PCAP files to various formats including CSV, LAS, PCD, and PLY.
    • Working with OSF Files: Read and write using the Ouster Sensor Format (OSF) API.

    Visualizing Point Clouds

    • Open3D: Visualize point clouds in real-time from a sensor or from a file.
    • Matplotlib: Visualize point clouds from a sensor or from a file.

    Understanding Sensor Data

    • The LidarFrame Object: Deep dive into the LidarFrame data structure.
    • 2D and 3D Projections: Work with 2D and 3D representations of the data.
    • Working with UDP Packets: Learn how to parse raw UDP packets.

    Pose Optimizer

    • Pose Optimizer API: Use the Pose Optimizer to refine sensor pose/motion.
  11. Use the Sophus Python API for Lie Groups and Lie Algebras

    master

    The Sophus Python API provides bindings for mathematical operations involving Lie groups and Lie algebras. It is organized into several modules based on the mathematical structure you are working with:

    • sophus.matrix: Matrix operations.
    • sophus.complex: Complex number operations.
    • sophus.quaternion: Quaternion-based rotations and transformations.
    • sophus.so2: Special Orthogonal group in 2D (rotations in 2D).
    • sophus.so3: Special Orthogonal group in 3D (rotations in 3D).
    • sophus.se2: Special Euclidean group in 2D (rigid body motions in 2D).
    • sophus.se3: Special Euclidean group in 3D (rigid body motions in 3D).

    Use these modules to perform geometric transformations, rotations, and manifold operations required for lidar processing and spatial reasoning.