Maps a controller from OpenDrive. More...
#include <TrafficLightController.h>
Private Member Functions | |
float | GetStateTime (const ETrafficLightState State) const |
void | SetStateTime (const ETrafficLightState State, float NewTime) |
Private Attributes | |
FString | ControllerId = "" |
ETrafficLightState | CurrentLightState = ETrafficLightState::Green |
int | CurrentState = 0 |
float | ElapsedTime = 0 |
TArray< FTrafficLightStage > | LightStates |
int | Sequence = 0 |
TArray< FCarlaActor * > | TrafficLightCarlaActors |
ATrafficLightGroup * | TrafficLightGroup |
TArray< UTrafficLightComponent * > | TrafficLights |
Maps a controller from OpenDrive.
Controls the asociated traffic lights and contains its cycles
Definition at line 36 of file TrafficLightController.h.
UTrafficLightController::UTrafficLightController | ( | ) |
Definition at line 9 of file TrafficLightController.cpp.
void UTrafficLightController::AddCarlaActorTrafficLight | ( | FCarlaActor * | CarlaActor | ) |
Definition at line 77 of file TrafficLightController.cpp.
References TrafficLightCarlaActors.
void UTrafficLightController::AddTrafficLight | ( | UTrafficLightComponent * | TrafficLight | ) |
Definition at line 66 of file TrafficLightController.cpp.
References TrafficLights.
Referenced by ATrafficLightManager::RegisterLightComponentFromOpenDRIVE().
bool UTrafficLightController::AdvanceTimeAndCycleFinished | ( | float | DeltaTime | ) |
Definition at line 32 of file TrafficLightController.cpp.
References ElapsedTime, GetCurrentState(), IsCycleFinished(), and NextState().
Referenced by ATrafficLightGroup::Tick().
void UTrafficLightController::EmptyTrafficLights | ( | ) |
Definition at line 60 of file TrafficLightController.cpp.
References TrafficLightCarlaActors, and TrafficLights.
const FString & UTrafficLightController::GetControllerId | ( | ) | const |
Definition at line 87 of file TrafficLightController.cpp.
References ControllerId.
|
inline |
Definition at line 128 of file TrafficLightController.h.
const FTrafficLightStage & UTrafficLightController::GetCurrentState | ( | ) | const |
Definition at line 20 of file TrafficLightController.cpp.
References CurrentState, and LightStates.
Referenced by AdvanceTimeAndCycleFinished(), NextState(), ResetState(), and StartCycle().
float UTrafficLightController::GetElapsedTime | ( | ) | const |
Definition at line 185 of file TrafficLightController.cpp.
References ElapsedTime.
Referenced by FFrameData::AddTrafficLightState(), ACarlaRecorder::AddTrafficLightState(), and FWorldObserver_GetActorState().
float UTrafficLightController::GetGreenTime | ( | ) | const |
Definition at line 147 of file TrafficLightController.cpp.
References GetStateTime().
Referenced by FWorldObserver_GetActorState().
ATrafficLightGroup * UTrafficLightController::GetGroup | ( | ) |
Definition at line 200 of file TrafficLightController.cpp.
References TrafficLightGroup.
Referenced by FFrameData::AddTrafficLightState(), ACarlaRecorder::AddTrafficLightState(), CarlaReplayerHelper::ProcessReplayerStateTrafficLight(), and FFrameData::ProcessReplayerStateTrafficLight().
const ATrafficLightGroup * UTrafficLightController::GetGroup | ( | ) | const |
Definition at line 205 of file TrafficLightController.cpp.
References TrafficLightGroup.
float UTrafficLightController::GetRedTime | ( | ) | const |
Definition at line 157 of file TrafficLightController.cpp.
References GetStateTime().
Referenced by FWorldObserver_GetActorState().
int UTrafficLightController::GetSequence | ( | ) | const |
Definition at line 115 of file TrafficLightController.cpp.
References Sequence.
|
private |
Definition at line 173 of file TrafficLightController.cpp.
References LightStates.
Referenced by GetGreenTime(), GetRedTime(), and GetYellowTime().
const TArray< UTrafficLightComponent * > & UTrafficLightController::GetTrafficLights | ( | ) |
Definition at line 55 of file TrafficLightController.cpp.
References TrafficLights.
float UTrafficLightController::GetYellowTime | ( | ) | const |
Definition at line 152 of file TrafficLightController.cpp.
References GetStateTime().
Referenced by FWorldObserver_GetActorState().
bool UTrafficLightController::IsCycleFinished | ( | ) | const |
Definition at line 97 of file TrafficLightController.cpp.
References CurrentState, and LightStates.
Referenced by AdvanceTimeAndCycleFinished().
float UTrafficLightController::NextState | ( | ) |
Definition at line 25 of file TrafficLightController.cpp.
References CurrentState, GetCurrentState(), LightStates, SetTrafficLightsState(), State, and FTrafficLightStage::Time.
Referenced by AdvanceTimeAndCycleFinished().
void UTrafficLightController::RemoveCarlaActorTrafficLight | ( | FCarlaActor * | CarlaActor | ) |
Definition at line 82 of file TrafficLightController.cpp.
References TrafficLightCarlaActors.
void UTrafficLightController::RemoveTrafficLight | ( | UTrafficLightComponent * | TrafficLight | ) |
Definition at line 72 of file TrafficLightController.cpp.
References TrafficLights.
void UTrafficLightController::ResetState | ( | ) |
Definition at line 125 of file TrafficLightController.cpp.
References CurrentState, ElapsedTime, GetCurrentState(), LightStates, SetTrafficLightsState(), and State.
Referenced by ATrafficLightManager::RegisterLightComponentFromOpenDRIVE(), and SetStates().
void UTrafficLightController::SetControllerId | ( | const FString & | Id | ) |
Definition at line 92 of file TrafficLightController.cpp.
References ControllerId.
|
inline |
Definition at line 132 of file TrafficLightController.h.
Referenced by SetTrafficLightsState().
void UTrafficLightController::SetElapsedTime | ( | float | InElapsedTime | ) |
Definition at line 190 of file TrafficLightController.cpp.
References ElapsedTime.
Referenced by CarlaReplayerHelper::ProcessReplayerStateTrafficLight(), and FFrameData::ProcessReplayerStateTrafficLight().
void UTrafficLightController::SetGreenTime | ( | float | NewTime | ) |
Definition at line 142 of file TrafficLightController.cpp.
References SetStateTime().
Referenced by ATrafficLightBase::SetGreenTime().
void UTrafficLightController::SetGroup | ( | ATrafficLightGroup * | Group | ) |
Definition at line 195 of file TrafficLightController.cpp.
References TrafficLightGroup.
Referenced by ATrafficLightGroup::AddController().
void UTrafficLightController::SetRedTime | ( | float | NewTime | ) |
Definition at line 137 of file TrafficLightController.cpp.
References SetStateTime().
Referenced by ATrafficLightBase::SetRedTime().
void UTrafficLightController::SetSequence | ( | int | InSequence | ) |
Definition at line 120 of file TrafficLightController.cpp.
References Sequence.
void UTrafficLightController::SetStates | ( | TArray< FTrafficLightStage > | States | ) |
Definition at line 14 of file TrafficLightController.cpp.
References LightStates, and ResetState().
|
private |
Definition at line 162 of file TrafficLightController.cpp.
References LightStates.
Referenced by SetGreenTime(), SetRedTime(), and SetYellowTime().
void UTrafficLightController::SetTrafficLightsState | ( | ETrafficLightState | NewState | ) |
Definition at line 102 of file TrafficLightController.cpp.
References SetCurrentLightState(), TrafficLightCarlaActors, and TrafficLights.
Referenced by NextState(), ResetState(), and StartCycle().
void UTrafficLightController::SetYellowTime | ( | float | NewTime | ) |
Definition at line 132 of file TrafficLightController.cpp.
References SetStateTime().
Referenced by ATrafficLightBase::SetYellowTime().
void UTrafficLightController::StartCycle | ( | ) |
Definition at line 48 of file TrafficLightController.cpp.
References CurrentState, ElapsedTime, GetCurrentState(), SetTrafficLightsState(), and State.
Referenced by ATrafficLightGroup::NextController(), and ATrafficLightGroup::ResetGroup().
|
private |
Definition at line 144 of file TrafficLightController.h.
Referenced by GetControllerId(), and SetControllerId().
|
private |
Definition at line 172 of file TrafficLightController.h.
|
private |
Definition at line 147 of file TrafficLightController.h.
Referenced by GetCurrentState(), IsCycleFinished(), NextState(), ResetState(), and StartCycle().
|
private |
Definition at line 170 of file TrafficLightController.h.
Referenced by AdvanceTimeAndCycleFinished(), GetElapsedTime(), ResetState(), SetElapsedTime(), and StartCycle().
|
private |
Definition at line 151 of file TrafficLightController.h.
Referenced by GetCurrentState(), GetStateTime(), IsCycleFinished(), NextState(), ResetState(), SetStates(), and SetStateTime().
|
private |
Definition at line 167 of file TrafficLightController.h.
Referenced by GetSequence(), and SetSequence().
|
private |
Definition at line 160 of file TrafficLightController.h.
Referenced by AddCarlaActorTrafficLight(), EmptyTrafficLights(), RemoveCarlaActorTrafficLight(), and SetTrafficLightsState().
|
private |
Definition at line 163 of file TrafficLightController.h.
Referenced by GetGroup(), and SetGroup().
|
private |
Definition at line 158 of file TrafficLightController.h.
Referenced by AddTrafficLight(), EmptyTrafficLights(), GetTrafficLights(), RemoveTrafficLight(), and SetTrafficLightsState().