Traffic Lights¶
- class py123d.datatypes.TrafficLightDetections[source]¶
The TrafficLightDetections is a container for multiple traffic light detections. It provides methods to access individual detections as well as to retrieve a detection by lane id. The wrapper is used to read and write traffic light detections from/to logs.
Public Data Attributes:
detectionsList of individual
TrafficLightDetection.timestampThe
Timestampof the traffic light detections.metadataThe metadata for the traffic light detections.
Inherited from
BaseModalitytimestampReturns the timestamp associated with this modality data, if available.
metadataReturns the metadata associated with this modality data.
modality_typeConvenience property to access the modality type directly from the modality data.
modality_idConvenience property to access the modality id directly from the modality data.
modality_keyConvenience property to access the modality key directly from the modality data.
Public Methods:
get_by_lane_id(lane_id)Retrieve a traffic light detection by its lane id.
- property detections: List[TrafficLightDetection]¶
List of individual
TrafficLightDetection.
- property metadata: TrafficLightDetectionsMetadata¶
The metadata for the traffic light detections.
- 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.
- class py123d.datatypes.TrafficLightDetection[source]¶
Single traffic light detection of a lane, that includes the lane id and status (green, yellow, red, off, unknown).
Public Data Attributes:
lane_idThe lane id associated with the traffic light detection.
statusThe
TrafficLightStatusof the traffic light detection.
- property status: TrafficLightStatus¶
The
TrafficLightStatusof the traffic light detection.