maliput
Intersection Class Reference

Detailed Description

A concrete implementation of the api::Intersection abstract interface.

#include <include/maliput/base/intersection.h>

Inheritance diagram for Intersection:
[legend]

Public Member Functions

 Intersection (const Id &id, const std::vector< api::LaneSRange > &region, const api::rules::PhaseRing &ring, ManualPhaseProvider *phase_provider)
 Constructs an Intersection instance. More...
 
virtual ~Intersection ()=default
 
std::optional< api::rules::PhaseProvider::ResultPhase () const override
 Returns the current phase. More...
 
void SetPhase (const api::rules::Phase::Id &phase_id, const std::optional< api::rules::Phase::Id > &next_phase=std::nullopt, const std::optional< double > &duration_until=std::nullopt) override
 Sets the current Phase and optionally the next Phase. More...
 
- Public Member Functions inherited from Intersection
 Intersection (const Id &id, const std::vector< LaneSRange > &region, const rules::PhaseRing &ring)
 Constructs an Intersection instance. More...
 
const Idid () const
 Returns the persistent identifier. More...
 
const std::vector< LaneSRange > & region () const
 Returns the region. See constructor parameter region for more details. More...
 
const rules::PhaseRing::Idring_id () const
 Returns the rules::PhaseRing::Id of the rules::PhaseRing that applies to this intersection. More...
 
const std::optional< rules::BulbStatesbulb_states () const
 Returns the current bulb states within the intersection. More...
 
const std::optional< rules::DiscreteValueRuleStatesDiscreteValueRuleStates () const
 Returns the current discrete value rule states within the intersection. More...
 
const std::optional< rules::RuleStates > RuleStates () const
 Returns the current RightOfWayRule states within the intersection. More...
 
bool Includes (const rules::TrafficLight::Id &id) const
 Determines whether the rules::TrafficLight::Id is within this Intersection. More...
 
bool Includes (const rules::DiscreteValueRule::Id &id) const
 Determines whether the rules::DiscreteValueRule::Id is within this Intersection. More...
 
bool Includes (const rules::RightOfWayRule::Id &id) const
 Determines whether the rules::RightOfWayRule::Id is within this Intersection. More...
 
bool Includes (const InertialPosition &inertial_position, const RoadGeometry *road_geometry) const
 Determines whether inertial_position is within this Intersection::Region(). More...
 

Additional Inherited Members

- Public Types inherited from Intersection
using Id = TypeSpecificIdentifier< class Intersection >
 Unique identifier for an Intersection. More...
 

Constructor & Destructor Documentation

◆ Intersection()

Intersection ( const Id id,
const std::vector< api::LaneSRange > &  region,
const api::rules::PhaseRing ring,
ManualPhaseProvider phase_provider 
)

Constructs an Intersection instance.

Parameters
idThe intersection's unique ID.
regionThe region of the road network that is part of the intersection.
ringThe PhaseRing that defines the phases within the intersection.
phase_providerEnables the current phase within an api::rules::PhaseRing with ID ring_id to be specified and obtained. The pointer must remain valid throughout this class instance's lifetime.

◆ ~Intersection()

virtual ~Intersection ( )
virtualdefault

Reimplemented from Intersection.

Member Function Documentation

◆ Phase()

std::optional<api::rules::PhaseProvider::Result> Phase ( ) const
overridevirtual

Returns the current phase.

Implements Intersection.

◆ SetPhase()

void SetPhase ( const api::rules::Phase::Id phase_id,
const std::optional< api::rules::Phase::Id > &  next_phase = std::nullopt,
const std::optional< double > &  duration_until = std::nullopt 
)
overridevirtual

Sets the current Phase and optionally the next Phase.

Exceptions
std::exceptionif duration_until is defined when next_phase is undefined.

Implements Intersection.


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