Class In charge of creating and assigning traffic light groups, controllers and components. More...
#include <TrafficLightManager.h>
Public Member Functions | |
ATrafficLightManager () | |
void | GenerateSignalsAndTrafficLights () |
UTrafficLightController * | GetController (FString ControllerId) |
bool | GetFrozen () |
const boost::optional< carla::road::Map > & | GetMap () |
ATrafficLightGroup * | GetTrafficGroup (int JunctionId) |
USignComponent * | GetTrafficSign (FString SignId) |
void | InitializeTrafficLights () |
void | MatchTrafficLightActorsWithOpenDriveSignals () |
void | RegisterLightComponentFromOpenDRIVE (UTrafficLightComponent *TrafficLight) |
void | RegisterLightComponentGenerated (UTrafficLightComponent *TrafficLight) |
void | RemoveGeneratedSignalsAndTrafficLights () |
void | SetFrozen (bool InFrozen) |
Private Member Functions | |
void | RemoveAttachedProps (TArray< AActor *> Actors) const |
void | RemoveRoadrunnerProps () const |
void | SpawnSignals () |
void | SpawnTrafficLights () |
Private Attributes | |
bool | bTrafficLightsFrozen = false |
USceneComponent * | SceneComponent |
TMap< FString, TSubclassOf< USignComponent > > | SignComponentModels |
TMap< FString, TSubclassOf< AActor > > | SpeedLimitModels |
TMap< FString, UTrafficLightController * > | TrafficControllers |
TMap< int, ATrafficLightGroup * > | TrafficGroups |
int | TrafficLightComponentMissingId = -1 |
int | TrafficLightControllerMissingId = -1 |
int | TrafficLightGroupMissingId = -2 |
TSubclassOf< AActor > | TrafficLightModel |
bool | TrafficLightsGenerated = false |
TMap< FString, USignComponent * > | TrafficSignComponents |
TArray< ATrafficSignBase * > | TrafficSigns |
TMap< FString, TSubclassOf< AActor > > | TrafficSignsModels |
Class In charge of creating and assigning traffic light groups, controllers and components.
Definition at line 19 of file TrafficLightManager.h.
ATrafficLightManager::ATrafficLightManager | ( | ) |
Definition at line 25 of file TrafficLightManager.cpp.
References SceneComponent, SignComponentModels, SpeedLimitModels, carla::road::SignalType::StopSign(), TrafficLightGroupMissingId, TrafficLightModel, TrafficSignsModels, and carla::road::SignalType::YieldSign().
void ATrafficLightManager::GenerateSignalsAndTrafficLights | ( | ) |
Definition at line 255 of file TrafficLightManager.cpp.
References RemoveRoadrunnerProps(), SpawnSignals(), SpawnTrafficLights(), TrafficLightModel, and TrafficLightsGenerated.
Referenced by InitializeTrafficLights().
UTrafficLightController * ATrafficLightManager::GetController | ( | FString | ControllerId | ) |
Definition at line 798 of file TrafficLightManager.cpp.
References TrafficControllers.
bool ATrafficLightManager::GetFrozen | ( | ) |
Definition at line 783 of file TrafficLightManager.cpp.
References bTrafficLightsFrozen.
const boost::optional< carla::road::Map > & ATrafficLightManager::GetMap | ( | ) |
Definition at line 250 of file TrafficLightManager.cpp.
References UCarlaStatics::GetGameMode(), and ACarlaGameModeBase::GetMap().
Referenced by InitializeTrafficLights(), RegisterLightComponentFromOpenDRIVE(), SpawnSignals(), and SpawnTrafficLights().
ATrafficLightGroup * ATrafficLightManager::GetTrafficGroup | ( | int | JunctionId | ) |
Definition at line 788 of file TrafficLightManager.cpp.
References TrafficGroups.
USignComponent * ATrafficLightManager::GetTrafficSign | ( | FString | SignId | ) |
Definition at line 807 of file TrafficLightManager.cpp.
References TrafficSignComponents.
void ATrafficLightManager::InitializeTrafficLights | ( | ) |
Definition at line 362 of file TrafficLightManager.cpp.
References GenerateSignalsAndTrafficLights(), GetMap(), carla::log_warning(), and TrafficLightsGenerated.
void ATrafficLightManager::MatchTrafficLightActorsWithOpenDriveSignals | ( | ) |
Definition at line 294 of file TrafficLightManager.cpp.
References ATrafficLightBase::GetTrafficLightComponent(), UOpenDrive::GetXODR(), carla::opendrive::OpenDriveParser::Load(), carla::log_warning(), and TrafficLight.
void ATrafficLightManager::RegisterLightComponentFromOpenDRIVE | ( | UTrafficLightComponent * | TrafficLight | ) |
Definition at line 129 of file TrafficLightManager.cpp.
References UTrafficLightController::AddTrafficLight(), UCarlaStatics::GetGameMode(), GetMap(), ACarlaGameModeBase::GetULevelFromName(), ATrafficLightGroup::JunctionId, UTrafficLightController::ResetState(), TrafficControllers, TrafficGroups, TrafficLightControllerMissingId, TrafficLightGroupMissingId, and TrafficSignComponents.
Referenced by SpawnTrafficLights().
void ATrafficLightManager::RegisterLightComponentGenerated | ( | UTrafficLightComponent * | TrafficLight | ) |
Definition at line 211 of file TrafficLightManager.cpp.
References TrafficControllers, TrafficGroups, TrafficLight, TrafficLightComponentMissingId, TrafficLightControllerMissingId, TrafficLightGroupMissingId, and TrafficSignComponents.
|
private |
Definition at line 842 of file TrafficLightManager.cpp.
Referenced by RemoveRoadrunnerProps().
void ATrafficLightManager::RemoveGeneratedSignalsAndTrafficLights | ( | ) |
Definition at line 275 of file TrafficLightManager.cpp.
References TrafficControllers, TrafficGroups, TrafficLightsGenerated, and TrafficSigns.
|
private |
Definition at line 816 of file TrafficLightManager.cpp.
References RemoveAttachedProps().
Referenced by GenerateSignalsAndTrafficLights().
void ATrafficLightManager::SetFrozen | ( | bool | InFrozen | ) |
Definition at line 762 of file TrafficLightManager.cpp.
References bTrafficLightsFrozen, and TrafficGroups.
|
private |
Definition at line 605 of file TrafficLightManager.cpp.
References GetClosestTrafficSignActor(), UCarlaStatics::GetGameMode(), GetMap(), ACarlaGameModeBase::GetULevelFromName(), carla::log_warning(), carla::road::SignalType::MaximumSpeed(), SignComponentModels, SpeedLimitModels, TrafficSignComponents, TrafficSigns, and TrafficSignsModels.
Referenced by GenerateSignalsAndTrafficLights().
|
private |
Definition at line 482 of file TrafficLightManager.cpp.
References UCarlaStatics::GetGameMode(), GetMap(), ATrafficLightBase::GetTrafficLightComponent(), ACarlaGameModeBase::GetULevelFromName(), carla::road::SignalType::IsTrafficLight(), carla::log_warning(), RegisterLightComponentFromOpenDRIVE(), TrafficLight, TrafficLightModel, and TrafficSigns.
Referenced by GenerateSignalsAndTrafficLights().
|
private |
Definition at line 119 of file TrafficLightManager.h.
Referenced by GetFrozen(), and SetFrozen().
|
private |
Definition at line 101 of file TrafficLightManager.h.
Referenced by ATrafficLightManager().
|
private |
Definition at line 95 of file TrafficLightManager.h.
Referenced by ATrafficLightManager(), and SpawnSignals().
|
private |
Definition at line 98 of file TrafficLightManager.h.
Referenced by ATrafficLightManager(), and SpawnSignals().
|
private |
Definition at line 78 of file TrafficLightManager.h.
Referenced by GetController(), RegisterLightComponentFromOpenDRIVE(), RegisterLightComponentGenerated(), and RemoveGeneratedSignalsAndTrafficLights().
|
private |
Definition at line 74 of file TrafficLightManager.h.
Referenced by GetTrafficGroup(), RegisterLightComponentFromOpenDRIVE(), RegisterLightComponentGenerated(), RemoveGeneratedSignalsAndTrafficLights(), and SetFrozen().
|
private |
Definition at line 116 of file TrafficLightManager.h.
Referenced by RegisterLightComponentGenerated().
|
private |
Definition at line 112 of file TrafficLightManager.h.
Referenced by RegisterLightComponentFromOpenDRIVE(), and RegisterLightComponentGenerated().
|
private |
Definition at line 108 of file TrafficLightManager.h.
Referenced by ATrafficLightManager(), RegisterLightComponentFromOpenDRIVE(), and RegisterLightComponentGenerated().
|
private |
Definition at line 88 of file TrafficLightManager.h.
Referenced by ATrafficLightManager(), GenerateSignalsAndTrafficLights(), and SpawnTrafficLights().
|
private |
Definition at line 104 of file TrafficLightManager.h.
Referenced by GenerateSignalsAndTrafficLights(), InitializeTrafficLights(), and RemoveGeneratedSignalsAndTrafficLights().
|
private |
Definition at line 82 of file TrafficLightManager.h.
Referenced by GetTrafficSign(), RegisterLightComponentFromOpenDRIVE(), RegisterLightComponentGenerated(), and SpawnSignals().
|
private |
Definition at line 85 of file TrafficLightManager.h.
Referenced by RemoveGeneratedSignalsAndTrafficLights(), SpawnSignals(), and SpawnTrafficLights().
|
private |
Definition at line 92 of file TrafficLightManager.h.
Referenced by ATrafficLightManager(), and SpawnSignals().