torchdrivesim.traffic_lights¶
Attributes¶
Classes¶
Generic enumeration. |
|
Representing a single state of a group of traffic lights. |
|
Functions¶
|
Module Contents¶
- class torchdrivesim.traffic_lights.TrafficLightState[source]¶
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- class torchdrivesim.traffic_lights.TrafficLightGroupState[source]¶
Representing a single state of a group of traffic lights.
- class torchdrivesim.traffic_lights.TrafficLightStateMachine(group_states: List[TrafficLightGroupState])[source]¶
-
- classmethod from_json(json_file_path: str) typing_extensions.Self [source]¶
Current json format: [
- {
- “actor_states”: {
“4411”: “red”, “3411”: “red”, ………
}, “state”: “0”, “duration”: 10, “next_state”: “1”
]
- set_to(state_index: int, time_remaining: float)[source]¶
Set the TrafficLightStateMachine to a specific state.
- property states: List[TrafficLightGroupState][source]¶
- property current_state: TrafficLightGroupState[source]¶
- class torchdrivesim.traffic_lights.TrafficLightController(traffic_fsms: List[TrafficLightStateMachine])[source]¶
- torchdrivesim.traffic_lights.current_light_state_tensor_from_controller(traffic_light_controller: TrafficLightController, traffic_light_ids: List[int]) torch.Tensor [source]¶