46 UFUNCTION(BlueprintCallable)
49 UFUNCTION(BlueprintCallable, CallInEditor, Category=
"Config")
50 void StartRecordingSensorData();
52 UFUNCTION(BlueprintCallable, CallInEditor, Category=
"Config")
53 void StopRecordingSensorData();
55 UFUNCTION(BlueprintCallable, CallInEditor, Category=
"Config")
56 void ToggleRadarVisibility();
60 virtual void BeginPlay()
override;
62 virtual void Tick(
float DeltaSeconds)
override;
65 UPROPERTY(BlueprintReadOnly, Category=
"Components")
66 TObjectPtr<USceneComponent> SceneComp;
69 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Config")
73 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Config|Spawn")
74 TSubclassOf<
AActor> AttachActorClass;
77 UPROPERTY(EditAnywhere, BlueprintReadOnly, meta=(ClampMin=0.f, ClampMax=40.f), Category="Config|Spawn")
78 float InitialDelay = 4.f;
81 UPROPERTY(EditAnywhere, BlueprintReadOnly, meta=(ClampMin=0.f, ClampMax=40.f), Category="Config|Spawn")
82 float DelayBetweenSpawns = 0.f;
85 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Config|Spawn")
86 FVector MaxSpawnLocation {-110000.f, -100000.f, 9600.f};
89 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=
"Config|Spawn")
90 FVector MinSpawnLocation {-120000.f, -110000.f, 9300.f};
93 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=
"Config|SaveData")
94 bool bSaveDataAtBeginPlay = false;
97 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Config|SaveData")
98 TSubclassOf<class
ASensor> SensorClassToCapture;
101 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Config|SaveData")
102 FString SaveImagePath;
105 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Config|Radar")
106 float VelocityRange = 0.075;
108 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Config|Radar")
109 float PointSize = 15.0f;
114 bool bRecordingData = false;
116 bool bRadarVisibility = false;
119 void OnEpisodeInitialised(
UCarlaEpisode* InitialisedEpisode);
122 void SpawnSensorsDelayed();
127 void GetRandomTransform(FTransform &Transform) const;
129 void SpawnSensorActor(const
FActorDescription& SensorDescription,
bool bAttachToActor);
133 void AddSensorToSaveDataArray(
AActor* Actor);
135 void SaveSensorData(
float DeltaSeconds);
137 void AttachSensorToActor(
AActor* SensorActor);
139 void DrawRadarSensorPoints() const;
144 FTimerHandle InitialDelaySpawnTimerHandle;
147 FTimerHandle SpawnSensorsDelayedTimerHandle;
154 TArray<TObjectPtr<
ASensor>> SpawnedSensorsArray;