Class OsfFrameSetSource

Inheritance Relationships

Base Types

  • public ouster::sdk::core::FrameSetSourceClass FrameSetSource

  • private ouster::sdk::impl::FrameSetSourceBuilder< ouster::sdk::core::IoType::OSF, OsfFrameSetSource >

Class Documentation

class OsfFrameSetSource : public ouster::sdk::core::FrameSetSource, private ouster::sdk::impl::FrameSetSourceBuilder<ouster::sdk::core::IoType::OSF, OsfFrameSetSource>

FrameSetSource that produces LidarFrames from a given OSF file.

Public Functions

OsfFrameSetSource(const std::string &file, const std::function<void(OsfFrameSetSourceOptions&)> &options = {})

open_source compatible constructor

Parameters:
  • file[in] OSF file to open

  • options[in] frame set source options

OsfFrameSetSource(const std::string &file, OsfFrameSetSourceOptions options)

open_source compatible constructor

Parameters:
  • file[in] OSF file to open

  • options[in] frame set source options

virtual ouster::sdk::core::FrameSetIterator begin() const override

Provides each frame from all sensors in time order.

Returns:

start iterator for all sensors

virtual ouster::sdk::core::FrameSetIterator begin(int sensor_index) const override

Provides frames from a single sensor in time order If idx < 0 provides frames from all sensors.

Parameters:
  • sensor_index[in] sensor index

  • sensor_index[in] sensor index

Throws:

std::runtime_error – if sensor_idx >= number of sensors

Returns:

start iterator for the sensor with the given index

virtual size_t size() const override

The length of the source from begin to end.

For example: If uncollated this is the total number of frames in the source, if collated this is the number of frame collations.

Throws:

std::runtime_error – if unindexed

Returns:

length of the source

virtual size_t size_hint() const override

The approximate length of the source if unindexed, or the real size if indexed.

Live sources or sources with undefined length will return 0.

Returns:

approximate length of source

virtual const std::vector<size_t> &frames_num() const override

Get the frame count for each sensor in the file.

Throws:

std::runtime_error – if unindexed

Returns:

frame count for each sensor in the file

virtual const std::vector<std::vector<std::pair<uint64_t, uint64_t>>> &individual_index() const override

timestamp based index of all frames in the file for each sensor, each pair is timestamp followed by global frame index

Throws:

std::runtime_error – if unindexed

Returns:

index

virtual const std::vector<std::pair<uint64_t, uint64_t>> &full_index() const override

timestamp based index of all frames in the file, each pair is timestamp followed by sensor index

Throws:

std::runtime_error – if unindexed

Returns:

index

virtual bool is_indexed() const override

Indicates if the source contains an index for fast random access.

Returns:

if indexed or not

virtual const std::vector<std::shared_ptr<ouster::sdk::core::SensorInfo>> &sensor_info() const override

Get the sensor info for each sensor in this dataset.

Returns:

sensor info for each sensor

virtual std::unique_ptr<FrameSetSource> move() override

move into a newly allocated item

Returns:

a unique pointer to a newly allocated FrameSetSource instance containing the moved-from state.

virtual bool is_collated() const override

Check if the source provides collated frames.

Returns:

true if collations are provided.

virtual bool contains_collations() const override

Check if the most underlying source stores collated frames.

Returns:

true if collations are stored.

static std::unique_ptr<core::FrameSetSource> create(const std::vector<std::string> &sources, const FrameSetSourceOptions &options, bool collate, int sensor_idx = -1)

open_source compatible factory that handles different collating behaviours.

Parameters:
  • sources[in] source filenames

  • options[in] source options

  • collate[in] whether to collate the source or not

  • sensor_idx[in] access specific sensor index in the osf

Returns:

unique_ptr of FrameSetSource type