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

#include <SensorSpawnerActor.h>

+ Inheritance diagram for ASensorSpawnerActor:

Public Member Functions

 ASensorSpawnerActor ()
 
void SpawnSensors ()
 
void StartRecordingSensorData ()
 
void StopRecordingSensorData ()
 
void ToggleRadarVisibility ()
 

Protected Member Functions

virtual void BeginPlay () override
 
virtual void Tick (float DeltaSeconds) override
 

Protected Attributes

TSubclassOf< AActor > AttachActorClass
 
bool bSaveDataAtBeginPlay = false
 
float DelayBetweenSpawns = 0.f
 
float InitialDelay = 4.f
 
FVector MaxSpawnLocation {-110000.f, -100000.f, 9600.f}
 
FVector MinSpawnLocation {-120000.f, -110000.f, 9300.f}
 
float PointSize = 15.0f
 
FString SaveImagePath
 
TObjectPtr< USceneComponent > SceneComp
 
TSubclassOf< class ASensor > SensorClassToCapture
 
TArray< FSensorTuple > SensorsToSpawn
 
float VelocityRange = 0.075
 

Private Member Functions

void AddSensorToSaveDataArray (AActor *Actor)
 
void AttachSensorToActor (AActor *SensorActor)
 
void DrawRadarSensorPoints () const
 
void GenerateSensorActorDescription (const FActorDefinition *Definition, FActorDescription &SensorDescription) const
 
const FActorDefinition * GetActorDefinitionByClass (const TSubclassOf< AActor > ActorClass) const
 
void GetRandomTransform (FTransform &Transform) const
 
void OnEpisodeInitialised (UCarlaEpisode *InitialisedEpisode)
 
void SaveSensorData (float DeltaSeconds)
 
void SpawnSensorActor (const FActorDescription &SensorDescription, bool bAttachToActor)
 
void SpawnSensorsDelayed ()
 

Private Attributes

bool bRadarVisibility = false
 
bool bRecordingData = false
 
TObjectPtr< UCarlaEpisode > CarlaEpisode
 
FTimerHandle InitialDelaySpawnTimerHandle
 
TArray< FSensorTuple > SensorsToSpawnCopy
 
TArray< TObjectPtr< ASensor > > SpawnedSensorsArray
 
FTimerHandle SpawnSensorsDelayedTimerHandle
 

Detailed Description

Definition at line 38 of file SensorSpawnerActor.h.

Constructor & Destructor Documentation

◆ ASensorSpawnerActor()

ASensorSpawnerActor::ASensorSpawnerActor ( )

Definition at line 21 of file SensorSpawnerActor.cpp.

References SaveImagePath, SceneComp, and SensorClassToCapture.

Member Function Documentation

◆ AddSensorToSaveDataArray()

void ASensorSpawnerActor::AddSensorToSaveDataArray ( AActor *  Actor)
private

Definition at line 208 of file SensorSpawnerActor.cpp.

References bRecordingData, SensorClassToCapture, and SpawnedSensorsArray.

Referenced by SpawnSensorActor().

◆ AttachSensorToActor()

void ASensorSpawnerActor::AttachSensorToActor ( AActor *  SensorActor)
private

Definition at line 279 of file SensorSpawnerActor.cpp.

References AttachActorClass.

Referenced by SpawnSensorActor().

◆ BeginPlay()

void ASensorSpawnerActor::BeginPlay ( )
overrideprotectedvirtual

◆ DrawRadarSensorPoints()

void ASensorSpawnerActor::DrawRadarSensorPoints ( ) const
private

Definition at line 294 of file SensorSpawnerActor.cpp.

References PointSize, SpawnedSensorsArray, and VelocityRange.

Referenced by Tick().

◆ GenerateSensorActorDescription()

void ASensorSpawnerActor::GenerateSensorActorDescription ( const FActorDefinition *  Definition,
FActorDescription &  SensorDescription 
) const
private

◆ GetActorDefinitionByClass()

const FActorDefinition * ASensorSpawnerActor::GetActorDefinitionByClass ( const TSubclassOf< AActor >  ActorClass) const
private

Definition at line 120 of file SensorSpawnerActor.cpp.

References CarlaEpisode, FActorDefinition::Class, and IsValid().

Referenced by SpawnSensors(), and SpawnSensorsDelayed().

◆ GetRandomTransform()

void ASensorSpawnerActor::GetRandomTransform ( FTransform &  Transform) const
private

Definition at line 176 of file SensorSpawnerActor.cpp.

References MaxSpawnLocation, and MinSpawnLocation.

Referenced by SpawnSensorActor().

◆ OnEpisodeInitialised()

void ASensorSpawnerActor::OnEpisodeInitialised ( UCarlaEpisode *  InitialisedEpisode)
private

◆ SaveSensorData()

void ASensorSpawnerActor::SaveSensorData ( float  DeltaSeconds)
private

◆ SpawnSensorActor()

void ASensorSpawnerActor::SpawnSensorActor ( const FActorDescription &  SensorDescription,
bool  bAttachToActor 
)
private

◆ SpawnSensors()

void ASensorSpawnerActor::SpawnSensors ( )

◆ SpawnSensorsDelayed()

void ASensorSpawnerActor::SpawnSensorsDelayed ( )
private

◆ StartRecordingSensorData()

void ASensorSpawnerActor::StartRecordingSensorData ( )

Definition at line 89 of file SensorSpawnerActor.cpp.

References bRecordingData, and SpawnedSensorsArray.

◆ StopRecordingSensorData()

void ASensorSpawnerActor::StopRecordingSensorData ( )

Definition at line 102 of file SensorSpawnerActor.cpp.

References bRecordingData, and SpawnedSensorsArray.

◆ Tick()

void ASensorSpawnerActor::Tick ( float  DeltaSeconds)
overrideprotectedvirtual

Definition at line 220 of file SensorSpawnerActor.cpp.

References bRadarVisibility, bRecordingData, DrawRadarSensorPoints(), SaveSensorData(), and Tick().

Referenced by Tick().

◆ ToggleRadarVisibility()

void ASensorSpawnerActor::ToggleRadarVisibility ( )

Definition at line 115 of file SensorSpawnerActor.cpp.

References bRadarVisibility.

Member Data Documentation

◆ AttachActorClass

TSubclassOf<AActor> ASensorSpawnerActor::AttachActorClass
protected

Definition at line 74 of file SensorSpawnerActor.h.

Referenced by AttachSensorToActor().

◆ bRadarVisibility

bool ASensorSpawnerActor::bRadarVisibility = false
private

Definition at line 116 of file SensorSpawnerActor.h.

Referenced by Tick(), and ToggleRadarVisibility().

◆ bRecordingData

bool ASensorSpawnerActor::bRecordingData = false
private

◆ bSaveDataAtBeginPlay

bool ASensorSpawnerActor::bSaveDataAtBeginPlay = false
protected

Definition at line 94 of file SensorSpawnerActor.h.

Referenced by BeginPlay().

◆ CarlaEpisode

TObjectPtr<UCarlaEpisode> ASensorSpawnerActor::CarlaEpisode
private

◆ DelayBetweenSpawns

float ASensorSpawnerActor::DelayBetweenSpawns = 0.f
protected

Definition at line 82 of file SensorSpawnerActor.h.

Referenced by SpawnSensors().

◆ InitialDelay

float ASensorSpawnerActor::InitialDelay = 4.f
protected

Definition at line 78 of file SensorSpawnerActor.h.

Referenced by OnEpisodeInitialised().

◆ InitialDelaySpawnTimerHandle

FTimerHandle ASensorSpawnerActor::InitialDelaySpawnTimerHandle
private

Definition at line 144 of file SensorSpawnerActor.h.

Referenced by OnEpisodeInitialised().

◆ MaxSpawnLocation

FVector ASensorSpawnerActor::MaxSpawnLocation {-110000.f, -100000.f, 9600.f}
protected

Definition at line 86 of file SensorSpawnerActor.h.

Referenced by GetRandomTransform().

◆ MinSpawnLocation

FVector ASensorSpawnerActor::MinSpawnLocation {-120000.f, -110000.f, 9300.f}
protected

Definition at line 90 of file SensorSpawnerActor.h.

Referenced by GetRandomTransform().

◆ PointSize

float ASensorSpawnerActor::PointSize = 15.0f
protected

Definition at line 109 of file SensorSpawnerActor.h.

Referenced by DrawRadarSensorPoints().

◆ SaveImagePath

FString ASensorSpawnerActor::SaveImagePath
protected

Definition at line 102 of file SensorSpawnerActor.h.

Referenced by ASensorSpawnerActor(), BeginPlay(), and SaveSensorData().

◆ SceneComp

TObjectPtr<USceneComponent> ASensorSpawnerActor::SceneComp
protected

Definition at line 66 of file SensorSpawnerActor.h.

Referenced by ASensorSpawnerActor().

◆ SensorClassToCapture

TSubclassOf<class ASensor> ASensorSpawnerActor::SensorClassToCapture
protected

Definition at line 98 of file SensorSpawnerActor.h.

Referenced by AddSensorToSaveDataArray(), and ASensorSpawnerActor().

◆ SensorsToSpawn

TArray<FSensorTuple> ASensorSpawnerActor::SensorsToSpawn
protected

Definition at line 70 of file SensorSpawnerActor.h.

Referenced by SpawnSensors().

◆ SensorsToSpawnCopy

TArray<FSensorTuple> ASensorSpawnerActor::SensorsToSpawnCopy
private

Definition at line 150 of file SensorSpawnerActor.h.

Referenced by SpawnSensors(), and SpawnSensorsDelayed().

◆ SpawnedSensorsArray

TArray<TObjectPtr<ASensor> > ASensorSpawnerActor::SpawnedSensorsArray
private

◆ SpawnSensorsDelayedTimerHandle

FTimerHandle ASensorSpawnerActor::SpawnSensorsDelayedTimerHandle
private

Definition at line 147 of file SensorSpawnerActor.h.

Referenced by SpawnSensors(), and SpawnSensorsDelayed().

◆ VelocityRange

float ASensorSpawnerActor::VelocityRange = 0.075
protected

Definition at line 106 of file SensorSpawnerActor.h.

Referenced by DrawRadarSensorPoints().


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