maliput
|
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 Id & | id () const |
Returns this BulbGroup instance's unique identifier. More... | |
UniqueBulbGroupId | unique_id () const |
Returns this BulbGroup instance's unique identifier. More... | |
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. More... | |
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. More... | |
std::vector< const Bulb * > | bulbs () const |
Returns the bulbs contained within this bulb group. More... | |
const Bulb * | GetBulb (const Bulb::Id &id) const |
Gets the specified Bulb. Returns nullptr if id is unrecognized. More... | |
const TrafficLight * | traffic_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... | |
using Id = TypeSpecificIdentifier<BulbGroup> |
Unique identifier for a 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.
id | The bulb group's ID. It must be unique in the context of the TrafficLight that contains it. |
Inertial
space.position_traffic_light | The 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_light | The 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. |
bulbs | The 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. |
common::assertion_error | When there are Bulbs with the same Bulb::Id in bulbs . |
common::assertion_error | When any of the Bulbs in bulbs is nullptr. |
std::vector< const Bulb * > bulbs | ( | ) | const |
Returns the bulbs contained within this bulb group.
Gets the specified Bulb. Returns nullptr if id
is unrecognized.
MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN | ( | BulbGroup | ) |
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.
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.
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.
common::assertion_error | When traffic_light is nullptr. |
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.
UniqueBulbGroupId unique_id | ( | ) | const |
Returns this BulbGroup instance's unique identifier.
common::assertion_error | When the parent TrafficLight has not been registered. |