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 18 of file TrafficLightManager.h.

Constructor & Destructor Documentation

◆ ATrafficLightManager()

ATrafficLightManager::ATrafficLightManager ( )

Definition at line 21 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 230 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 773 of file TrafficLightManager.cpp.

References TrafficControllers.

◆ GetFrozen()

bool ATrafficLightManager::GetFrozen ( )

Definition at line 758 of file TrafficLightManager.cpp.

References bTrafficLightsFrozen.

◆ GetMap()

const boost::optional< carla::road::Map > & ATrafficLightManager::GetMap ( )

Definition at line 225 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 763 of file TrafficLightManager.cpp.

References TrafficGroups.

◆ GetTrafficSign()

USignComponent * ATrafficLightManager::GetTrafficSign ( FString  SignId)

Definition at line 782 of file TrafficLightManager.cpp.

References TrafficSignComponents.

◆ InitializeTrafficLights()

void ATrafficLightManager::InitializeTrafficLights ( )

Definition at line 337 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 269 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 104 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 817 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 791 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 737 of file TrafficLightManager.cpp.

References bTrafficLightsFrozen, and TrafficGroups.

◆ SpawnSignals()

void ATrafficLightManager::SpawnSignals ( )
private

Definition at line 580 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 457 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 118 of file TrafficLightManager.h.

Referenced by GetFrozen(), and SetFrozen().

◆ SceneComponent

USceneComponent* ATrafficLightManager::SceneComponent
private

Definition at line 100 of file TrafficLightManager.h.

Referenced by ATrafficLightManager().

◆ SignComponentModels

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

Definition at line 94 of file TrafficLightManager.h.

Referenced by ATrafficLightManager(), and SpawnSignals().

◆ SpeedLimitModels

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

Definition at line 97 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 115 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 91 of file TrafficLightManager.h.

Referenced by ATrafficLightManager(), and SpawnSignals().


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