CARLA
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ATrafficLightBase Class Reference

#include <TrafficLightBase.h>

+ Inheritance diagram for ATrafficLightBase:

Public Member Functions

void AddTimeToRecorder ()
 
 ATrafficLightBase (const FObjectInitializer &ObjectInitializer)
 
float GetElapsedTime () const
 
float GetGreenTime () const
 
TArray< ATrafficLightBase * > GetGroupTrafficLights () const
 
int GetPoleIndex () const
 
float GetRedTime () const
 
bool GetTimeIsFrozen () const
 
UTrafficLightComponent * GetTrafficLightComponent ()
 
const UTrafficLightComponent * GetTrafficLightComponent () const
 
ETrafficLightState GetTrafficLightState () const
 
float GetYellowTime () const
 
void LightChangedCompatibility (ETrafficLightState NewLightState)
 
void NotifyWheeledVehicle (ACarlaWheeledVehicle *Vehicle)
 
void SetElapsedTime (float InElapsedTime)
 
void SetGreenTime (float InGreenTime)
 
void SetGroupTrafficLights (TArray< ATrafficLightBase * > InGroupTrafficLights)
 
void SetPoleIndex (int InPoleIndex)
 
void SetRedTime (float InRedTime)
 
void SetTimeIsFrozen (bool InTimeIsFrozen)
 
void SetTrafficLightState (ETrafficLightState State)
 
void SetYellowTime (float InYellowTime)
 
void UnNotifyWheeledVehicle (ACarlaWheeledVehicle *Vehicle)
 
- Public Member Functions inherited from ATrafficSignBase
 ATrafficSignBase (const FObjectInitializer &ObjectInitializer)
 
int32 GetSpeedLimitKmh () const
 km/h this sign limits to, -1 when it is not a speed-limit sign.
 
ETrafficSignState GetTrafficSignState () const
 
UBoxComponent * GetTriggerVolume () const
 
TArray< UBoxComponent * > GetTriggerVolumes () const
 
void SetSpeedLimitKmh (int32 Kmh)
 Make this a speed-limit sign for Kmh: picks the dedicated state when one exists, the custom state (value kept in SpeedLimitKmh) otherwise.
 
void SetTrafficSignState (ETrafficSignState State)
 

Protected Member Functions

void OnTrafficLightStateChanged (ETrafficLightState TrafficLightState)
 

Private Attributes

TArray< TObjectPtr< ATrafficLightBase > > GroupTrafficLights
 
int PoleIndex = 0
 
TObjectPtr< UTrafficLightComponent > TrafficLightComponent = nullptr
 
TArray< TObjectPtr< AWheeledVehicleAIController > > Vehicles
 

Additional Inherited Members

- Public Attributes inherited from ATrafficSignBase
bool bGeneratedFromOpenDRIVE = false
 True for signs/lights generated from the OpenDRIVE map.
 
bool bPositioned = false
 True once this sign has been snapped to the ground, to avoid adjusting it more than once.
 

Detailed Description

Definition at line 20 of file TrafficLightBase.h.

Constructor & Destructor Documentation

◆ ATrafficLightBase()

ATrafficLightBase::ATrafficLightBase ( const FObjectInitializer &  ObjectInitializer)

Member Function Documentation

◆ AddTimeToRecorder()

void ATrafficLightBase::AddTimeToRecorder ( )

Definition at line 267 of file TrafficLightBase.cpp.

References UCarlaStatics::GetRecorder().

Referenced by SetGreenTime(), SetRedTime(), and SetYellowTime().

◆ GetElapsedTime()

float ATrafficLightBase::GetElapsedTime ( ) const

Definition at line 178 of file TrafficLightBase.cpp.

References TrafficLightComponent.

◆ GetGreenTime()

float ATrafficLightBase::GetGreenTime ( ) const

Definition at line 112 of file TrafficLightBase.cpp.

References TrafficLightComponent.

◆ GetGroupTrafficLights()

TArray< ATrafficLightBase * > ATrafficLightBase::GetGroupTrafficLights ( ) const

◆ GetPoleIndex()

int ATrafficLightBase::GetPoleIndex ( ) const

Definition at line 226 of file TrafficLightBase.cpp.

References PoleIndex.

◆ GetRedTime()

float ATrafficLightBase::GetRedTime ( ) const

Definition at line 164 of file TrafficLightBase.cpp.

References TrafficLightComponent.

◆ GetTimeIsFrozen()

bool ATrafficLightBase::GetTimeIsFrozen ( ) const

Definition at line 210 of file TrafficLightBase.cpp.

References TrafficLightComponent.

◆ GetTrafficLightComponent() [1/2]

UTrafficLightComponent * ATrafficLightBase::GetTrafficLightComponent ( )

◆ GetTrafficLightComponent() [2/2]

const UTrafficLightComponent * ATrafficLightBase::GetTrafficLightComponent ( ) const

Definition at line 262 of file TrafficLightBase.cpp.

References TrafficLightComponent.

◆ GetTrafficLightState()

ETrafficLightState ATrafficLightBase::GetTrafficLightState ( ) const

Definition at line 52 of file TrafficLightBase.cpp.

References TrafficLightComponent.

Referenced by NotifyWheeledVehicle().

◆ GetYellowTime()

float ATrafficLightBase::GetYellowTime ( ) const

Definition at line 138 of file TrafficLightBase.cpp.

References TrafficLightComponent.

◆ LightChangedCompatibility()

void ATrafficLightBase::LightChangedCompatibility ( ETrafficLightState  NewLightState)

Definition at line 276 of file TrafficLightBase.cpp.

References OnTrafficLightStateChanged().

◆ NotifyWheeledVehicle()

void ATrafficLightBase::NotifyWheeledVehicle ( ACarlaWheeledVehicle *  Vehicle)

Definition at line 73 of file TrafficLightBase.cpp.

References GetTrafficLightState(), IsValid(), Vehicle, and Vehicles.

◆ OnTrafficLightStateChanged()

void ATrafficLightBase::OnTrafficLightStateChanged ( ETrafficLightState  TrafficLightState)
protected

◆ SetElapsedTime()

void ATrafficLightBase::SetElapsedTime ( float  InElapsedTime)

Definition at line 192 of file TrafficLightBase.cpp.

References TrafficLightComponent.

◆ SetGreenTime()

void ATrafficLightBase::SetGreenTime ( float  InGreenTime)

◆ SetGroupTrafficLights()

void ATrafficLightBase::SetGroupTrafficLights ( TArray< ATrafficLightBase * >  InGroupTrafficLights)

Definition at line 253 of file TrafficLightBase.cpp.

References GroupTrafficLights.

◆ SetPoleIndex()

void ATrafficLightBase::SetPoleIndex ( int  InPoleIndex)

Definition at line 221 of file TrafficLightBase.cpp.

References PoleIndex.

◆ SetRedTime()

void ATrafficLightBase::SetRedTime ( float  InRedTime)

◆ SetTimeIsFrozen()

void ATrafficLightBase::SetTimeIsFrozen ( bool  InTimeIsFrozen)

Definition at line 202 of file TrafficLightBase.cpp.

References TrafficLightComponent.

◆ SetTrafficLightState()

void ATrafficLightBase::SetTrafficLightState ( ETrafficLightState  State)

Definition at line 64 of file TrafficLightBase.cpp.

References TrafficLightComponent.

◆ SetYellowTime()

void ATrafficLightBase::SetYellowTime ( float  InYellowTime)

◆ UnNotifyWheeledVehicle()

void ATrafficLightBase::UnNotifyWheeledVehicle ( ACarlaWheeledVehicle *  Vehicle)

Definition at line 87 of file TrafficLightBase.cpp.

References IsValid(), and Vehicle.

Member Data Documentation

◆ GroupTrafficLights

TArray<TObjectPtr<ATrafficLightBase> > ATrafficLightBase::GroupTrafficLights
private

Definition at line 107 of file TrafficLightBase.h.

Referenced by GetGroupTrafficLights(), and SetGroupTrafficLights().

◆ PoleIndex

int ATrafficLightBase::PoleIndex = 0
private

Definition at line 104 of file TrafficLightBase.h.

Referenced by GetPoleIndex(), and SetPoleIndex().

◆ TrafficLightComponent

TObjectPtr<UTrafficLightComponent> ATrafficLightBase::TrafficLightComponent = nullptr
private

◆ Vehicles

TArray<TObjectPtr<AWheeledVehicleAIController> > ATrafficLightBase::Vehicles
private

Definition at line 101 of file TrafficLightBase.h.

Referenced by NotifyWheeledVehicle().


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