maliput
BulbGroup Class Referencefinal

Detailed Description

Models a group of bulbs within a traffic light.

All of the bulbs within a group should share the same approximate orientation. However, this is not programmatically enforced.

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

Public Types

using Id = TypeSpecificIdentifier< BulbGroup >
 Unique identifier for a BulbGroup. More...
 

Public Member Functions

 MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN (BulbGroup)
 
 BulbGroup (const Id &id, const InertialPosition &position_traffic_light, const Rotation &orientation_traffic_light, std::vector< std::unique_ptr< Bulb >> bulbs)
 Constructs a BulbGroup instance. More...
 
const Idid () const
 Returns this BulbGroup instance's unique identifier. More...
 
UniqueBulbGroupId unique_id () const
 Returns this BulbGroup instance's unique identifier. More...
 
const InertialPositionposition_traffic_light () const
 Returns the linear offset of this bulb group's frame relative to the frame of the traffic light that contains it. More...
 
const Rotationorientation_traffic_light () const
 Returns the rotational offset of this bulb group's frame relative to the frame of the traffic light that contains it. More...
 
std::vector< const Bulb * > bulbs () const
 Returns the bulbs contained within this bulb group. More...
 
const BulbGetBulb (const Bulb::Id &id) const
 Gets the specified Bulb. Returns nullptr if id is unrecognized. More...
 
const TrafficLighttraffic_light () const
 Returns the parent TrafficLight of the bulb group. More...
 
void SetTrafficLight (common::Passkey< TrafficLight >, const TrafficLight *traffic_light)
 Sets the parent TrafficLight pointer. More...
 

Member Typedef Documentation

◆ Id

Unique identifier for a BulbGroup.

Constructor & Destructor Documentation

◆ BulbGroup()

BulbGroup ( const Id id,
const InertialPosition position_traffic_light,
const Rotation orientation_traffic_light,
std::vector< std::unique_ptr< Bulb >>  bulbs 
)

Constructs a BulbGroup instance.

Parameters
idThe bulb group's ID. It must be unique in the context of the TrafficLight that contains it.
See also
UniqueBulbGroupId to uniquely identify a BulbGroup in the Inertial space.
Parameters
position_traffic_lightThe linear offset of this bulb group's frame relative to the frame of the traffic light that contains it. The origin of this bulb group's frame should approximate the bulb group's CoM.
orientation_traffic_lightThe rotational offset of this bulb group's frame relative to the frame of the traffic light that contains it. The +Z axis should align with the bulb group's "up" direction, and the +X axis should point in the direction that the bulb group is facing. Following a right-handed coordinate frame, the +Y axis should point left when facing the +X direction.
bulbsThe bulbs that are part of this BulbGroup. There must be at least one bulb within this group. There must not be Bulbs with the same Bulb::Id. Null bulbs are not allowed.
Exceptions
common::assertion_errorWhen there are Bulbs with the same Bulb::Id in bulbs.
common::assertion_errorWhen any of the Bulbs in bulbs is nullptr.

Member Function Documentation

◆ bulbs()

std::vector< const Bulb * > bulbs ( ) const

Returns the bulbs contained within this bulb group.

◆ GetBulb()

const Bulb * GetBulb ( const Bulb::Id id) const

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

◆ id()

const Id& id ( ) const

Returns this BulbGroup instance's unique identifier.

◆ MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN()

MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN ( BulbGroup  )

◆ orientation_traffic_light()

const Rotation& orientation_traffic_light ( ) const

Returns the rotational offset of this bulb group's frame relative to the frame of the traffic light that contains it.

◆ position_traffic_light()

const InertialPosition& position_traffic_light ( ) const

Returns the linear offset of this bulb group's frame relative to the frame of the traffic light that contains it.

◆ SetTrafficLight()

void SetTrafficLight ( common::Passkey< TrafficLight ,
const TrafficLight traffic_light 
)

Sets the parent TrafficLight pointer.

This method is thought to be called once by traffic_light at its construct time.

Exceptions
common::assertion_errorWhen traffic_light is nullptr.

◆ traffic_light()

const TrafficLight* traffic_light ( ) const

Returns the parent TrafficLight of the bulb group.

When this bulb group has not been registered in a TrafficLight, this method returns nullptr.

◆ unique_id()

UniqueBulbGroupId unique_id ( ) const

Returns this BulbGroup instance's unique identifier.

Exceptions
common::assertion_errorWhen the parent TrafficLight has not been registered.
See also
SetTrafficLight().

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