maliput
|
A concrete implementation of the api::rules::PhaseProvider abstract interface that allows the current phase to be manually set.
#include <include/maliput/base/manual_phase_provider.h>
Public Member Functions | |
MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN (ManualPhaseProvider) | |
ManualPhaseProvider () | |
~ManualPhaseProvider () override | |
void | AddPhaseRing (const api::rules::PhaseRing::Id &id, const api::rules::Phase::Id &initial_phase, const std::optional< api::rules::Phase::Id > &initial_next_phase=std::nullopt, const std::optional< double > &initial_duration_until=std::nullopt) |
Adds a phase ring to this provider. More... | |
void | SetPhase (const api::rules::PhaseRing::Id &id, const api::rules::Phase::Id &phase, const std::optional< api::rules::Phase::Id > &next_phase=std::nullopt, const std::optional< double > &duration_until=std::nullopt) |
Sets the current phase of a PhaseRing. More... | |
![]() | |
MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN (PhaseProvider) | |
virtual | ~PhaseProvider ()=default |
std::optional< Result > | GetPhase (const PhaseRing::Id &id) const |
Gets the phase within a specified PhaseRing. More... | |
Static Public Member Functions | |
static std::unique_ptr< ManualPhaseProvider > | GetDefaultPopulatedManualPhaseProvider (const maliput::api::rules::PhaseRingBook *phase_ring_book) |
Constructs a ManualPhaseProvider populated from a given PhaseRingBook. More... | |
Additional Inherited Members | |
![]() | |
using | Result = StateProviderResult< Phase::Id > |
Result returned by GetPhase(). More... | |
![]() | |
PhaseProvider ()=default | |
|
overridedefault |
void AddPhaseRing | ( | const api::rules::PhaseRing::Id & | id, |
const api::rules::Phase::Id & | initial_phase, | ||
const std::optional< api::rules::Phase::Id > & | initial_next_phase = std::nullopt , |
||
const std::optional< double > & | initial_duration_until = std::nullopt |
||
) |
Adds a phase ring to this provider.
std::exception | if a PhaseRing with an ID of id already exists in this provider, or if initial_duration_until is defined when next_phase is undefined |
|
static |
Constructs a ManualPhaseProvider populated from a given PhaseRingBook.
The initial phase for each ring is the arbitrarily chosen.
phase_ring_book | The PhaseRingBook to use. |
maliput::common::assertion_error | When phase_ring_book is nullptr. |
MALIPUT_NO_COPY_NO_MOVE_NO_ASSIGN | ( | ManualPhaseProvider | ) |
void SetPhase | ( | const api::rules::PhaseRing::Id & | id, |
const api::rules::Phase::Id & | phase, | ||
const std::optional< api::rules::Phase::Id > & | next_phase = std::nullopt , |
||
const std::optional< double > & | duration_until = std::nullopt |
||
) |
Sets the current phase of a PhaseRing.
std::exception | if no PhaseRing with ID id exists in this provider, or if duration_until is defined when next_phase is undefined. |