maliput
|
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 Id & | id () const |
Returns this traffic light's unique identifier. More... | |
const InertialPosition & | position_road_network () const |
Returns this traffic light's frame's position within the road network's frame. More... | |
const Rotation & | orientation_road_network () const |
std::vector< const BulbGroup * > | bulb_groups () const |
Returns the bulb groups contained within this traffic light. More... | |
const BulbGroup * | GetBulbGroup (const BulbGroup::Id &id) const |
Gets the specified BulbGroup. Returns nullptr if id is unrecognized. More... | |
using Id = TypeSpecificIdentifier<TrafficLight> |
Unique identifier for a traffic light.
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.
id | The traffic light's ID. It must be unique in the context of the TrafficLightBook that contains it. |
position_road_network | The 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_network | The 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_groups | The 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. |
common::assertion_error | When there are BulbGroups with the same BulbGroup::Id in bulb_groups . |
common::assertion_error | When any of the BulbGroup in bulb_groups is nullptr. |
std::vector< const BulbGroup * > bulb_groups | ( | ) | const |
Returns the bulb groups contained within this traffic light.
const BulbGroup * GetBulbGroup | ( | const BulbGroup::Id & | id | ) | const |
Gets the specified BulbGroup. Returns nullptr if id
is unrecognized.
const Id& id | ( | ) | const |
Returns this traffic light's unique identifier.
MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN | ( | TrafficLight | ) |
const Rotation& orientation_road_network | ( | ) | const |
const InertialPosition& position_road_network | ( | ) | const |
Returns this traffic light's frame's position within the road network's frame.