maliput
TrafficLight Class Referencefinal

Detailed 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.

#include <include/maliput/api/rules/traffic_lights.h>

Public Types

using Id = TypeSpecificIdentifier< TrafficLight >
 Unique identifier for a traffic light. More...
 

Public Member Functions

 MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN (TrafficLight)
 
 TrafficLight (const Id &id, const InertialPosition &position_road_network, const Rotation &orientation_road_network, std::vector< std::unique_ptr< BulbGroup >> bulb_groups)
 Constructs a TrafficLight instance. More...
 
const Idid () const
 Returns this traffic light's unique identifier. More...
 
const InertialPositionposition_road_network () const
 Returns this traffic light's frame's position within the road network's frame. More...
 
const Rotationorientation_road_network () const
 
std::vector< const BulbGroup * > bulb_groups () const
 Returns the bulb groups contained within this traffic light. More...
 
const BulbGroupGetBulbGroup (const BulbGroup::Id &id) const
 Gets the specified BulbGroup. Returns nullptr if id is unrecognized. More...
 

Member Typedef Documentation

◆ Id

Unique identifier for a traffic light.

Constructor & Destructor Documentation

◆ TrafficLight()

TrafficLight ( const Id id,
const InertialPosition position_road_network,
const Rotation orientation_road_network,
std::vector< std::unique_ptr< BulbGroup >>  bulb_groups 
)

Constructs a TrafficLight instance.

Parameters
idThe traffic light's ID. It must be unique in the context of the TrafficLightBook that contains it.
position_road_networkThe linear offset of the traffic light's frame relative to the road network's frame. The traffic light frame's origin should approximate the traffic light's CoM.
orientation_road_networkThe rotational offset of the traffic light's frame relative to the road network's frame. The traffic light's frame's +Z axis points in the traffic light's "up" direction. No constraints are placed on the orientations of the +X and +Y axes. However, it's recommended that they correspond, if possible, to the orientations of the bulb group frames within this traffic light. In particular, when the traffic light only has one bulb group, all three axes of both the traffic light and bulb group should ideally match, if possible.
bulb_groupsThe bulb groups that are part of this traffic light. There must not be BulbGroups with the same BulbGroup::Ids. Null bulb groups are not allowed.
Exceptions
common::assertion_errorWhen there are BulbGroups with the same BulbGroup::Id in bulb_groups.
common::assertion_errorWhen any of the BulbGroup in bulb_groups is nullptr.

Member Function Documentation

◆ bulb_groups()

std::vector< const BulbGroup * > bulb_groups ( ) const

Returns the bulb groups contained within this traffic light.

◆ GetBulbGroup()

const BulbGroup * GetBulbGroup ( const BulbGroup::Id id) const

Gets the specified BulbGroup. Returns nullptr if id is unrecognized.

◆ id()

const Id& id ( ) const

Returns this traffic light's unique identifier.

◆ MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN()

MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN ( TrafficLight  )

◆ orientation_road_network()

const Rotation& orientation_road_network ( ) const

◆ position_road_network()

const InertialPosition& position_road_network ( ) const

Returns this traffic light's frame's position within the road network's frame.


The documentation for this class was generated from the following files: