CARLA
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ATrafficLightManager Class Reference

Class In charge of creating and assigning traffic light groups, controllers and components. More...

#include <TrafficLightManager.h>

+ Inheritance diagram for ATrafficLightManager:
+ Collaboration diagram for ATrafficLightManager:

Public Member Functions

 ATrafficLightManager ()
 
void GenerateSignalsAndTrafficLights ()
 
UTrafficLightControllerGetController (FString ControllerId)
 
bool GetFrozen ()
 
const boost::optional< carla::road::Map > & GetMap ()
 
ATrafficLightGroupGetTrafficGroup (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< AActorTrafficLightModel
 
bool TrafficLightsGenerated = false
 
TMap< FString, USignComponent * > TrafficSignComponents
 
TArray< ATrafficSignBase * > TrafficSigns
 
TMap< FString, TSubclassOf< AActor > > TrafficSignsModels
 

Detailed Description

Class In charge of creating and assigning traffic light groups, controllers and components.

Definition at line 19 of file TrafficLightManager.h.

Constructor & Destructor Documentation

◆ ATrafficLightManager()

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().

+ Here is the call graph for this function:

Member Function Documentation

◆ GenerateSignalsAndTrafficLights()

void ATrafficLightManager::GenerateSignalsAndTrafficLights ( )

Definition at line 255 of file TrafficLightManager.cpp.

References RemoveRoadrunnerProps(), SpawnSignals(), SpawnTrafficLights(), TrafficLightModel, and TrafficLightsGenerated.

Referenced by InitializeTrafficLights().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetController()

UTrafficLightController * ATrafficLightManager::GetController ( FString  ControllerId)

Definition at line 798 of file TrafficLightManager.cpp.

References TrafficControllers.

◆ GetFrozen()

bool ATrafficLightManager::GetFrozen ( )

Definition at line 783 of file TrafficLightManager.cpp.

References bTrafficLightsFrozen.

◆ GetMap()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTrafficGroup()

ATrafficLightGroup * ATrafficLightManager::GetTrafficGroup ( int  JunctionId)

Definition at line 788 of file TrafficLightManager.cpp.

References TrafficGroups.

◆ GetTrafficSign()

USignComponent * ATrafficLightManager::GetTrafficSign ( FString  SignId)

Definition at line 807 of file TrafficLightManager.cpp.

References TrafficSignComponents.

◆ InitializeTrafficLights()

void ATrafficLightManager::InitializeTrafficLights ( )

Definition at line 362 of file TrafficLightManager.cpp.

References GenerateSignalsAndTrafficLights(), GetMap(), carla::log_warning(), and TrafficLightsGenerated.

+ Here is the call graph for this function:

◆ MatchTrafficLightActorsWithOpenDriveSignals()

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.

+ Here is the call graph for this function:

◆ RegisterLightComponentFromOpenDRIVE()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RegisterLightComponentGenerated()

void ATrafficLightManager::RegisterLightComponentGenerated ( UTrafficLightComponent *  TrafficLight)

◆ RemoveAttachedProps()

void ATrafficLightManager::RemoveAttachedProps ( TArray< AActor *>  Actors) const
private

Definition at line 842 of file TrafficLightManager.cpp.

Referenced by RemoveRoadrunnerProps().

+ Here is the caller graph for this function:

◆ RemoveGeneratedSignalsAndTrafficLights()

void ATrafficLightManager::RemoveGeneratedSignalsAndTrafficLights ( )

◆ RemoveRoadrunnerProps()

void ATrafficLightManager::RemoveRoadrunnerProps ( ) const
private

Definition at line 816 of file TrafficLightManager.cpp.

References RemoveAttachedProps().

Referenced by GenerateSignalsAndTrafficLights().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetFrozen()

void ATrafficLightManager::SetFrozen ( bool  InFrozen)

Definition at line 762 of file TrafficLightManager.cpp.

References bTrafficLightsFrozen, and TrafficGroups.

◆ SpawnSignals()

void ATrafficLightManager::SpawnSignals ( )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SpawnTrafficLights()

void ATrafficLightManager::SpawnTrafficLights ( )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ bTrafficLightsFrozen

bool ATrafficLightManager::bTrafficLightsFrozen = false
private

Definition at line 119 of file TrafficLightManager.h.

Referenced by GetFrozen(), and SetFrozen().

◆ SceneComponent

USceneComponent* ATrafficLightManager::SceneComponent
private

Definition at line 101 of file TrafficLightManager.h.

Referenced by ATrafficLightManager().

◆ SignComponentModels

TMap<FString, TSubclassOf<USignComponent> > ATrafficLightManager::SignComponentModels
private

Definition at line 95 of file TrafficLightManager.h.

Referenced by ATrafficLightManager(), and SpawnSignals().

◆ SpeedLimitModels

TMap<FString, TSubclassOf<AActor> > ATrafficLightManager::SpeedLimitModels
private

Definition at line 98 of file TrafficLightManager.h.

Referenced by ATrafficLightManager(), and SpawnSignals().

◆ TrafficControllers

TMap<FString, UTrafficLightController *> ATrafficLightManager::TrafficControllers
private

◆ TrafficGroups

TMap<int, ATrafficLightGroup *> ATrafficLightManager::TrafficGroups
private

◆ TrafficLightComponentMissingId

int ATrafficLightManager::TrafficLightComponentMissingId = -1
private

Definition at line 116 of file TrafficLightManager.h.

Referenced by RegisterLightComponentGenerated().

◆ TrafficLightControllerMissingId

int ATrafficLightManager::TrafficLightControllerMissingId = -1
private

◆ TrafficLightGroupMissingId

int ATrafficLightManager::TrafficLightGroupMissingId = -2
private

◆ TrafficLightModel

TSubclassOf<AActor> ATrafficLightManager::TrafficLightModel
private

◆ TrafficLightsGenerated

bool ATrafficLightManager::TrafficLightsGenerated = false
private

◆ TrafficSignComponents

TMap<FString, USignComponent *> ATrafficLightManager::TrafficSignComponents
private

◆ TrafficSigns

TArray<ATrafficSignBase*> ATrafficLightManager::TrafficSigns
private

◆ TrafficSignsModels

TMap<FString, TSubclassOf<AActor> > ATrafficLightManager::TrafficSignsModels
private

Definition at line 92 of file TrafficLightManager.h.

Referenced by ATrafficLightManager(), and SpawnSignals().


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