stream_lidar_scan.h

Warning

doxygenstruct: Cannot find class “ouster::osf::zero_field” in doxygen xml output for project “cpp_api” from directory: /sdk-extensions/ouster-sdk/docs/_build/latest/doctrees/xml

class LidarScanStreamMeta : public ouster::osf::MetadataEntryHelper<LidarScanStreamMeta>

Metadata entry for LidarScanStream to store reference to a sensor and field_types

OSF type: ouster/v1/os_sensor/LidarScanStream

Flat Buffer Reference: fb/os_sensor/lidar_scan_stream.fbs

Public Functions

LidarScanStreamMeta(const uint32_t sensor_meta_id, const LidarScanFieldTypes field_types = {})
Parameters:
  • sensor_meta_id[in] Reference to LidarSensor metadata that describes the sensor configuration.

  • field_types[in] LidarScan fields specs, this argument is optional.

uint32_t sensor_meta_id() const

Return the sensor meta id.

Returns:

The sensor meta id.

const LidarScanFieldTypes &field_types() const

Return the field types.

Returns:

The field types.

virtual std::vector<uint8_t> buffer() const final

Byte represantation of the internal derived metadata type, used as serialization function when saving to OSF file.

Returns:

The byte vector representation of the metadata.

static std::unique_ptr<MetadataEntry> from_buffer(const std::vector<uint8_t> &buf)

Create a LidarScanStreamMeta object from a byte array.

Todo:

Figure out why this wasnt just done as a constructor overload.

Parameters:

buf[in] The raw flatbuffer byte vector to initialize from.

Returns:

The new LidarScanStreamMeta cast as a MetadataEntry

virtual std::string repr() const override

Get the string representation for the LidarScanStreamMeta object.

Returns:

The string representation for the LidarScanStreamMeta object.

template<>
struct MetadataTraits<LidarScanStreamMeta>
#include <stream_lidar_scan.h>

Templated struct for returning the OSF type string.

Public Static Functions

static inline const std::string type()

Return the OSF type string.

Returns:

The OSF type string “ouster/v1/os_sensor/LidarScanStream”.

class LidarScanStream : public ouster::osf::MessageStream<LidarScanStreamMeta, LidarScan>

LidarScanStream that encodes LidarScan objects into the messages.

Object type: ouster::sensor::LidarScan Meta type: LidarScanStreamMeta (sensor_meta_id, field_types)

Flatbuffer definition file: fb/os_sensor/lidar_scan_stream.fbs

Public Functions

LidarScanStream(Token key, Writer &writer, const uint32_t sensor_meta_id, const LidarScanFieldTypes &field_types = {})
Parameters:
  • key[in] Private class used to prevent non-friends from calling this.

  • writer[in] The writer object to use to write messages out.

  • sensor_meta_id[in] The sensor to use.

  • field_types[in] LidarScan fields specs, this argument is optional.

inline const meta_type &meta() const

Return the concrete metadata type. This has templated types.

Returns:

The concrete metadata type.

LidarScan ouster::osf::slice_with_cast(const LidarScan &ls_src, const LidarScanFieldTypes &field_types)

Cast ls_src LidarScan to a subset of fields with possible different underlying ChanFieldTypes.

Throws:

std::logic_error – Exception on trying to slice a scan with only a subset of the requested scans

Parameters:
  • ls_src[in] The LidarScan to cast.

  • field_types[in] The field types to cast the LidarScan to.

Returns:

a copy of ls_src with transformed fields.