Radar

Radar Data

class py123d.datatypes.Radar[source]

Data structure for Radar point cloud data and associated metadata.

Public Data Attributes:

radar_metadatas

Returns the dictionary of per-radar metadata contained in this Radar's metadata.

is_merged

Returns True if this Radar contains merged data from multiple radars, False if it contains data from a single radar.

metadata

The RadarMetadata associated with this Radar recording.

timestamp

The timestamp associated with this Radar recording.

point_cloud_3d

Radar 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 originating RadarID values, if available.

timestamps

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

cluster_id

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

rcs

The point cloud as an Nx1 array of radar cross section values (dBsm), if available.

velocity

The point cloud as an Nx2 array of raw (vx, vy) velocities in m/s, if available.

velocity_comp

The point cloud as an Nx2 array of ego-motion compensated (vx, vy) velocities in m/s, 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.

Private Methods:

_feature(feature)

Returns the requested feature array cast to its canonical dtype, if available.


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 radar_metadatas: Dict[RadarID, RadarMetadata]

Returns the dictionary of per-radar metadata contained in this Radar’s metadata.

If the metadata is a RadarMergedMetadata, returns its internal dictionary. If the metadata is a single RadarMetadata, returns a dictionary with one entry.

property is_merged: bool

Returns True if this Radar contains merged data from multiple radars, False if it contains data from a single radar.

property metadata: RadarMetadata | RadarMergedMetadata

The RadarMetadata associated with this Radar recording.

property timestamp: Timestamp

The timestamp associated with this Radar recording.

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

Radar 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 originating RadarID 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 cluster_id: ndarray[tuple[Any, ...], dtype[uint16]] | None

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

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

The point cloud as an Nx1 array of radar cross section values (dBsm), if available.

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

The point cloud as an Nx2 array of raw (vx, vy) velocities in m/s, if available.

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

The point cloud as an Nx2 array of ego-motion compensated (vx, vy) velocities in m/s, if available.

Radar Metadata

class py123d.datatypes.RadarMetadata[source]

Metadata for Radar sensor, static for a given sensor.

Public Data Attributes:

radar_name

The name of the Radar sensor from the dataset.

radar_id

The ID of the Radar sensor.

radar_to_imu_se3

The extrinsic PoseSE3 of the Radar 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 Radar metadata from a dictionary.

to_dict()

Convert the Radar 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 radar_name: str

The name of the Radar sensor from the dataset.

property radar_id: RadarID

The ID of the Radar sensor.

property radar_to_imu_se3: PoseSE3

The extrinsic PoseSE3 of the Radar 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 Radar metadata from a dictionary.

Parameters:

data_dict (dict) – A dictionary containing Radar metadata.

Return type:

RadarMetadata

Returns:

An instance of RadarMetadata.

to_dict()[source]

Convert the Radar metadata to a dictionary.

Return type:

Dict[str, Any]

Returns:

A dictionary representation of the Radar metadata.

property modality_key: str

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

class py123d.datatypes.RadarMergedMetadata[source]

Public Data Attributes:

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.

radar_metadatas

Returns the dictionary of per-radar metadata contained in this merged metadata.

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:

to_dict()

Serialize the metadata instance to a plain Python dictionary.

from_dict(data_dict)

Construct a metadata instance from a plain Python 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.

Inherited from Mapping

get(k[,d])

keys()

items()

values()


get(k[, d]) D[k] if k in D, else d.  d defaults to None.
items() a set-like object providing a view on D's items
keys() a set-like object providing a view on D's keys
property modality_key: str

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

values() an object providing a view on D's values
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.

property radar_metadatas: Dict[RadarID, RadarMetadata]

Returns the dictionary of per-radar metadata contained in this merged metadata.

to_dict()[source]

Serialize the metadata instance to a plain Python dictionary.

Return type:

Dict[str, Any]

Returns:

A dictionary representation using only default Python types.

classmethod from_dict(data_dict)[source]

Construct a metadata instance from a plain Python dictionary.

Parameters:

data_dict (Dict[str, Any]) – A dictionary containing the metadata fields.

Return type:

RadarMergedMetadata

Returns:

A metadata instance.

Radar IDs

class py123d.datatypes.RadarID[source]

Enumeration of Radar sensors, in multi-sensor setups.

RADAR_UNKNOWN = 0

Unknown Radar type.

RADAR_MERGED = 1

Merged sensor Radar type.

RADAR_FRONT = 2

Front-facing (center) Radar type.

RADAR_FRONT_LEFT = 3

Front-left corner Radar type.

RADAR_FRONT_RIGHT = 4

Front-right corner Radar type.

RADAR_SIDE_LEFT = 5

Left-side Radar type.

RADAR_SIDE_RIGHT = 6

Right-side Radar type.

RADAR_BACK_LEFT = 7

Back-left corner Radar type.

RADAR_BACK_RIGHT = 8

Back-right corner Radar type.

RADAR_BACK = 9

Back-facing (center) Radar type.

RADAR_REAR_LEFT = 10

Rear-left-facing Radar type (distinct from the back-left corner radar).

RADAR_REAR_RIGHT = 11

Rear-right-facing Radar type (distinct from the back-right corner radar).

Radar Features

class py123d.datatypes.RadarFeature[source]

Enumeration of common Radar point cloud features.

Aligned with the (rich) nuScenes radar schema; datasets populate the subset they provide. Extending is additive: append a member here and a dtype in RADAR_FEATURE_DTYPES.

IDS = 0

Per-point originating RadarID value. Used for merge/split, same role as IDS.

TIMESTAMPS = 1

Per-point timestamp feature index, in microseconds.

CLUSTER_ID = 2

Per-point cluster id feature index (the nuScenes id field).

DYN_PROP = 3

Dynamic property feature index (moving/stationary classification, dataset-native).

RCS = 4

Radar cross section feature index, in dBsm.

VELOCITY_X = 5

Raw radial velocity x feature index, in m/s.

VELOCITY_Y = 6

Raw radial velocity y feature index, in m/s.

VELOCITY_X_COMP = 7

Ego-motion compensated velocity x feature index, in m/s.

VELOCITY_Y_COMP = 8

Ego-motion compensated velocity y feature index, in m/s.

IS_QUALITY_VALID = 9

Quality-valid state flag feature index.

AMBIG_STATE = 10

Doppler ambiguity state feature index.

X_RMS = 11

x position RMS feature index.

Y_RMS = 12

y position RMS feature index.

INVALID_STATE = 13

Invalid state flag feature index.

PDH0 = 14

False-alarm probability feature index.

VX_RMS = 15

Velocity x RMS feature index.

VY_RMS = 16

Velocity y RMS feature index.

SNR = 17

Signal-to-noise ratio feature index, in dB.

EXIST_PROBABILITY = 18

Detection existence probability feature index.