ouster.sdk.bag

Module contents

Copyright (c) 2024, Ouster, Inc. All rights reserved.

Ouster Bag file support. Provides classes and utilities for reading, decoding, and processing Ouster lidar sensor data from ROS bag files. Includes tools for accessing raw sensor packets and assembling complete lidar frames.

Classes

ouster.sdk.bag.bag_frame_set_source

class BagFrameSetSource(file_path, *, extrinsics_file=None, raw_headers=False, raw_fields=False, soft_id_check=False, meta=None, field_names=None, extrinsics=[], **kwargs)[source]

Bases: FrameSetSource

Implements FrameSetSource protocol for pcap files with multiple sensors.

Parameters:
  • file_path (Union[str, List[str]]) – OSF filename as frames source

  • raw_headers (bool) – if True, include raw headers in decoded LidarFrames

  • raw_fields (bool) – if True, include raw fields in decoded LidarFrames

  • soft_id_check (bool) – if True, don’t skip packets on init_id/serial_num mismatch

  • meta (Optional[List[str]]) – optional list of metadata files to load, if not provided metadata is loaded from the bag instead

  • field_names (Optional[List[str]]) – list of fields to decode into a LidarFrame, if not provided decodes all default fields

  • extrinsics_file (str | None)

  • extrinsics (List[ndarray])

close(self) None[source]
property id_error_count: int
property is_live: bool

Check if the frame set source is live.

A live frame set source indicates that it is actively receiving data from a sensor.

Returns:

True if the frame set source is live, False otherwise.

Return type:

bool

property sensor_info: List[SensorInfo]

Retrieve sensor information for all sensors in the frame set source.

Returns:

A list of SensorInfo objects, each containing metadata about a sensor, such as serial number, firmware version, and calibration details.

property size_error_count: int

ouster.sdk.bag.bag_packet_source

class BagPacketSource(bag_path, *, extrinsics_file=None, meta=None, soft_id_check=False, extrinsics=[])[source]

Bases: PacketSource

Read a sensors packet streams out of a bag file as an iterator.

Read sensor data streams from a single bag file.

Parameters:
  • bag_path (Union[str, List[str]]) – path to bag file or folder containing ROS2 db3 and yaml file

  • meta (Optional[List[str]]) – optional list of metadata files to load, if not provided metadata is loaded from the bag instead

  • soft_id_check (bool) – if True, don’t skip packets on init_id mismatch

  • extrinsics_file (str | None)

  • extrinsics (List[ndarray])

close()[source]

Release Pcap resources. Thread-safe. :rtype: None

Return type:

None

property closed: bool

Check if source is closed. Thread-safe.

property id_error_count: int
property is_indexed: bool
property is_live: bool

Check if the packet source is live.

restart()[source]

Restart playback, only relevant to non-live sources :rtype: None

Return type:

None

property sensor_info: List[SensorInfo]

Metadata associated with the packet.

property size_error_count: int
class ChannelMetadata[source]

Bases: Structure

len

Structure/Union member

class MessageCount[source]

Bases: Structure

count

Structure/Union member

id

Structure/Union member

Submodules

ouster.sdk.bag.bag_scan_source

Copyright (c) 2024, Ouster, Inc. All rights reserved.

Deprecated module. Use ouster.sdk.bag.bag_frame_set_source instead.