pub struct TrafficLight<'a> {
pub traffic_light: &'a TrafficLight,
}
Expand description
Models a traffic light. A traffic light is a physical signaling device typically located at road intersections. It contains one or more groups of light bulbs with varying colors and shapes. The lighting patterns of the bulbs signify right-of-way rule information to the agents navigating the intersection (e.g., vehicles, bicyclists, pedestrians, etc.). Typically, an intersection will be managed by multiple traffic lights.
Note that traffic lights are physical manifestations of underlying right-of-way rules and thus naturally have lower signal-to-noise ratio relative to the underlying rules. Thus, oracular agents should directly use the underlying right-of-way rules instead of traffic lights when navigating intersections. TrafficLight exists for testing autonomous vehicles that do not have access to right-of-way rules.
Fields§
§traffic_light: &'a TrafficLight
Implementations§
Source§impl<'a> TrafficLight<'a>
impl<'a> TrafficLight<'a>
Sourcepub fn position_road_network(&self) -> InertialPosition
pub fn position_road_network(&self) -> InertialPosition
Get the position of the TrafficLight in the road network.
§Return
An crate::api::InertialPosition representing the position of the TrafficLight in the road network.
Sourcepub fn orientation_road_network(&self) -> Rotation
pub fn orientation_road_network(&self) -> Rotation
Get the orientation of the TrafficLight in the road network.
§Return
An crate::api::Rotation representing the orientation of the TrafficLight in the road network.
Sourcepub fn bulb_groups(&self) -> Vec<BulbGroup<'_>>
pub fn bulb_groups(&self) -> Vec<BulbGroup<'_>>
Get the bulb groups of the TrafficLight.
§Return
A vector of BulbGroups in the TrafficLight. If the TrafficLight has no bulb groups, return an empty vector.