maliput::api::rules

Struct TrafficLight

Source
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>

Source

pub fn id(&self) -> String

Get the id of the TrafficLight.

§Return

The id of the TrafficLight.

Source

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.

Source

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.

Source

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.

Source

pub fn get_bulb_group(&self, id: &String) -> Option<BulbGroup<'_>>

Get a BulbGroup by its id.

§Arguments
§Return

The BulbGroup with the given id. If no BulbGroup is found with the given id, return None.

Auto Trait Implementations§

§

impl<'a> Freeze for TrafficLight<'a>

§

impl<'a> RefUnwindSafe for TrafficLight<'a>

§

impl<'a> !Send for TrafficLight<'a>

§

impl<'a> !Sync for TrafficLight<'a>

§

impl<'a> Unpin for TrafficLight<'a>

§

impl<'a> UnwindSafe for TrafficLight<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.