Lidar

Lidar Data

class py123d.datatypes.Lidar[source]

Data structure for Lidar point cloud data and associated metadata.

Public Data Attributes:

lidar_metadatas

Returns the dictionary of per-lidar metadata contained in this Lidar's metadata.

is_merged

Returns True if this Lidar contains merged data from multiple lidars, False if it contains data from a single lidar.

metadata

The LidarMetadata associated with this Lidar recording.

timestamp

The timestamp associated with this Lidar recording.

timestamp_end

The end timestamp associated with this Lidar recording.

point_cloud_3d

Lidar point cloud as an Nx3 numpy array, where N is the number of points, and the (x, y, z), indexed by Point3DIndex

point_cloud_features

The point cloud features as a dictionary of numpy arrays.

xyz

The point cloud as an Nx3 array of x, y, z coordinates.

xy

The point cloud as an Nx2 array of x, y coordinates.

ids

The point cloud as an Nx1 array of point IDs, if available.

intensity

The point cloud as an Nx1 array of intensity values, if available.

channel

The point cloud as an Nx1 array of channel/ring values, if available.

timestamps

The point cloud as an Nx1 array of timestamps in microseconds, if available.

range

The point cloud as an Nx1 array of range values, if available.

elongation

The point cloud as an Nx1 array of elongation values, if available.

Inherited from BaseModality

timestamp

Returns the timestamp associated with this modality data, if available.

metadata

Returns the metadata associated with this modality data.

modality_type

Convenience property to access the modality type directly from the modality data.

modality_id

Convenience property to access the modality id directly from the modality data.

modality_key

Convenience property to access the modality key directly from the modality data.


property lidar_metadatas: Dict[LidarID, LidarMetadata]

Returns the dictionary of per-lidar metadata contained in this Lidar’s metadata.

If the metadata is a LidarMergedMetadata, returns its internal dictionary. If the metadata is a single LidarMetadata, returns a dictionary with one entry.

property is_merged: bool

Returns True if this Lidar contains merged data from multiple lidars, False if it contains data from a single lidar.

property metadata: LidarMetadata | LidarMergedMetadata

The LidarMetadata associated with this Lidar recording.

property modality_id: str | SerialIntEnum | None

Convenience property to access the modality id directly from the modality data.

property modality_key: str

Convenience property to access the modality key directly from the modality data.

property modality_type: ModalityType

Convenience property to access the modality type directly from the modality data.

property timestamp: Timestamp

The timestamp associated with this Lidar recording.

property timestamp_end: Timestamp

The end timestamp associated with this Lidar recording.

property point_cloud_3d: ndarray[tuple[Any, ...], dtype[float32]]

Lidar point cloud as an Nx3 numpy array, where N is the number of points, and the (x, y, z), indexed by Point3DIndex

property point_cloud_features: Dict[str, ndarray[tuple[Any, ...], dtype[_ScalarT]]] | None

The point cloud features as a dictionary of numpy arrays.

property xyz: ndarray[tuple[Any, ...], dtype[float32]]

The point cloud as an Nx3 array of x, y, z coordinates.

property xy: ndarray[tuple[Any, ...], dtype[float32]]

The point cloud as an Nx2 array of x, y coordinates.

property ids: ndarray[tuple[Any, ...], dtype[uint8]] | None

The point cloud as an Nx1 array of point IDs, if available.

property intensity: ndarray[tuple[Any, ...], dtype[uint8]] | None

The point cloud as an Nx1 array of intensity values, if available.

property channel: ndarray[tuple[Any, ...], dtype[uint8]] | None

The point cloud as an Nx1 array of channel/ring values, if available.

property timestamps: ndarray[tuple[Any, ...], dtype[int64]] | None

The point cloud as an Nx1 array of timestamps in microseconds, if available.

property range: ndarray[tuple[Any, ...], dtype[float32]] | None

The point cloud as an Nx1 array of range values, if available.

property elongation: ndarray[tuple[Any, ...], dtype[float32]] | None

The point cloud as an Nx1 array of elongation values, if available.

Lidar Metadata

class py123d.datatypes.LidarMetadata[source]

Metadata for Lidar sensor, static for a given sensor.

Public Data Attributes:

lidar_name

The name of the Lidar sensor from the dataset.

lidar_id

The ID of the Lidar sensor.

lidar_to_imu_se3

The extrinsic PoseSE3 of the Lidar sensor, relative to the IMU frame.

modality_type

Returns the type of the modality that this metadata describes.

modality_id

Optional identifier for the modality, e.g. sensor ID for sensor modalities.

Inherited from BaseModalityMetadata

modality_type

Returns the type of the modality that this metadata describes.

modality_id

Optional identifier for the modality, e.g. sensor ID for sensor modalities.

modality_key

Returns a unique key for this modality, combining type and id if applicable.

Public Methods:

from_dict(data_dict)

Construct the Lidar metadata from a dictionary.

to_dict()

Convert the Lidar metadata to a dictionary.

Inherited from BaseMetadata

to_dict()

Serialize the metadata instance to a plain Python dictionary.

from_dict(data_dict)

Construct a metadata instance from a plain Python dictionary.


property lidar_name: str

The name of the Lidar sensor from the dataset.

property lidar_id: LidarID

The ID of the Lidar sensor.

property lidar_to_imu_se3: PoseSE3

The extrinsic PoseSE3 of the Lidar sensor, relative to the IMU frame.

property modality_type: ModalityType

Returns the type of the modality that this metadata describes.

property modality_id: str | SerialIntEnum | None

Optional identifier for the modality, e.g. sensor ID for sensor modalities. Can be a string or a SerialIntEnum.

classmethod from_dict(data_dict)[source]

Construct the Lidar metadata from a dictionary.

Parameters:

data_dict (dict) – A dictionary containing Lidar metadata.

Raises:

ValueError – If the dictionary is missing required fields or contains invalid data.

Return type:

LidarMetadata

Returns:

An instance of LidarMetadata.

to_dict()[source]

Convert the Lidar metadata to a dictionary.

Return type:

Dict[str, Any]

Returns:

A dictionary representation of the Lidar metadata.

property modality_key: str

Returns a unique key for this modality, combining type and id if applicable.

Lidar IDs

class py123d.datatypes.LidarID[source]

Enumeration of Lidar sensors, in multi-sensor setups.

LIDAR_UNKNOWN = 0

Unknown Lidar type.

LIDAR_MERGED = 1

Merged sensor Lidar type

LIDAR_TOP = 2

Top-facing Lidar type.

LIDAR_FRONT = 3

Front-facing Lidar type.

LIDAR_SIDE_LEFT = 4

Left-side Lidar type.

LIDAR_SIDE_RIGHT = 5

Right-side Lidar type.

LIDAR_BACK = 6

Back-facing Lidar type.

LIDAR_DOWN = 7

Down-facing Lidar type.