Agrarsense
|
#include <SensorFactory.h>
Static Public Member Functions | |
static USensorMapDataAsset * | GetSensorMapDataAsset () |
static ALidar * | SpawnLidarSensor (const FTransform &transform, const FString sensorIdentifier, const FString sensorName, FLidarParameters lidarParameters, bool SimulateSensor=true, AActor *Parent=nullptr) |
static ACamera * | SpawnCamera (const FTransform &transform, const FString sensorIdentifier, const FString sensorName, FCameraBaseParameters cameraParameters, bool SimulateSensor=true, AActor *Parent=nullptr) |
static AThermalCamera * | SpawnThermalCamera (const FTransform &transform, const FString sensorIdentifier, const FString sensorName, FThermalCameraParameters thermalCameraParameters, bool SimulateSensor=true, AActor *Parent=nullptr) |
static ADepthCamera * | SpawnDepthCamera (const FTransform &transform, const FString sensorIdentifier, const FString sensorName, FDepthCameraParameters depthCameraParameters, bool SimulateSensor=true, AActor *Parent=nullptr) |
static ASemanticSegmentationCamera * | SpawnSegmentationCamera (const FTransform &transform, const FString sensorIdentifier, const FString sensorName, FCameraBaseParameters cameraParameters, bool SimulateSensor=true, AActor *Parent=nullptr) |
static ADVSCamera * | SpawnDVSCamera (const FTransform &transform, const FString sensorIdentifier, const FString sensorName, FDVSCameraParameters DVSCameraParameters, bool SimulateSensor, AActor *Parent=nullptr) |
static ARadar * | SpawnRadar (const FTransform &transform, const FString sensorIdentifier, const FString sensorName, FRadarParameters radarParameters, bool SimulateSensor=true, AActor *Parent=nullptr) |
static ACollisionSensor * | SpawnCollisionSensor (const FTransform &transform, AActor *Owner, const FString sensorIdentifier, const FString sensorName, bool SimulateSensor=true, AActor *Parent=nullptr) |
static ATransformSensor * | SpawnTransformSensor (const FTransform &transform, FTransformSensorParameters Parameters, const FString sensorIdentifier, const FString sensorName, bool SimulateSensor=true, AActor *Parent=nullptr) |
static AOverlapSensor * | SpawnOverlapSensor (const FTransform &transform, FOverlapSensorParameters Parameters, const FString sensorIdentifier, const FString sensorName, AActor *Parent=nullptr) |
Static Private Member Functions | |
template<typename T > | |
static T * | SpawnSensor (const FTransform &transform, const FString &sensorIdentifier, const FString &sensorName, bool SpawnSensorModel=true, AActor *Parent=nullptr) |
static void | SetSensorIdentifierAndNameWithFallbacks (ASensor *sensor, const FString &sensorIdentifier, const FString &sensorName) |
static ASensorModel * | SpawnModelClassForSensor (ASensor *attachTo) |
static ASensorModel * | SpawnModelClass (TSubclassOf< ASensorModel > modelClass, ASensor *attachTo) |
static void | Initialize () |
Static Private Attributes | |
static TWeakObjectPtr< USensorMapDataAsset > | SensorMapDataAsset |
SensorFactory is a UBlueprintFunctionLibrary based class in charge of spawning sensors. Sensors should not be spawned in any other way. Note. This Factory only works during runtime, don't call these functions in Editor without play mode on.
Definition at line 43 of file SensorFactory.h.
|
static |
Definition at line 50 of file SensorFactory.cpp.
References Initialize(), and SensorMapDataAsset.
Referenced by SpawnModelClassForSensor().
|
staticprivate |
Initialize the factory. Should be called before using data or calling functions
Definition at line 27 of file SensorFactory.cpp.
References SensorMapDataAsset.
Referenced by GetSensorMapDataAsset().
|
staticprivate |
Set sensor name and identifier but fallback to default values if sensor name and/or sensor identifier are empty.
sensor | Sensor which name and identifier to change |
sensorIdentifier | Sensor new identifier (empty identifier not accepted) |
sensorName | Sensor new name (empty name not accepted) |
Definition at line 64 of file SensorFactory.cpp.
References UEnumUtilities::ConvertSensorTypeToString(), ASensor::GetSensorIdentifier(), ASensor::GetSensorType(), ASensor::SetSensorIdentifier(), and ASensor::SetSensorName().
Referenced by SpawnSensor().
|
static |
Spawn new Camera sensor. BlueprintCallable.
FTransform | location to spawn sensor |
FString | Sensor's unique identifier |
FString | Sensor's name |
FCameraBaseParameters | FCameraBaseParameters parameters struct |
bool | Should the sensor start simulating after spawn |
Definition at line 105 of file SensorFactory.cpp.
References RGBCamera.
|
static |
Spawn new Collision sensor. BlueprintCallable.
FTransform | location to spawn sensor |
AActor* | Owning actor |
bool | Should the sensor start simulating after spawn |
Definition at line 177 of file SensorFactory.cpp.
References ACollisionSensor::Init().
Referenced by AVehicle::BeginPlay().
|
static |
Spawn new Camera sensor. BlueprintCallable.
FTransform | location to spawn sensor |
FString | Sensor's unique identifier |
FString | Sensor's name |
FCameraBaseParameters | FCameraBaseParameters parameters struct |
bool | Should the sensor start simulating after spawn |
Definition at line 129 of file SensorFactory.cpp.
References DepthCamera.
|
static |
Spawn new Camera sensor. BlueprintCallable.
FTransform | location to spawn sensor |
FString | Sensor's unique identifier |
FString | Sensor's name |
FCameraBaseParameters | FCameraBaseParameters parameters struct |
bool | Should the sensor start simulating after spawn |
Definition at line 153 of file SensorFactory.cpp.
References DVSCamera.
|
static |
Spawn new Lidar sensor. BlueprintCallable.
FTransform | location to spawn sensor |
FString | Sensor's unique identifier |
FString | Sensor's name |
FLidarParameters | FLidarParameters parameters struct |
bool | Should the sensor start simulating after spawn |
Definition at line 93 of file SensorFactory.cpp.
References ALidar::Init().
|
staticprivate |
Spawn sensor model (3D model) class attaching it to the given actor
ModelClass | ASensorModel class for the sensor's model's class |
attachTo | Attach to this sensor |
Definition at line 256 of file SensorFactory.cpp.
References ASensorModel::InitAfterSpawn(), ASensorModel::SetAttachedToSensor(), and ASensor::SetSensorModel().
Referenced by SpawnModelClassForSensor().
|
staticprivate |
Spawn sensor model (3D model) class attaching it to the given actor
attachTo | Sensor to attach to |
Definition at line 221 of file SensorFactory.cpp.
References USensorMapDataAsset::GetAssetDataBySensorType(), GetSensorMapDataAsset(), ASensor::GetSensorType(), USensorDataAsset::ModelClass, and SpawnModelClass().
Referenced by SpawnSensor().
|
static |
Spawn new Overlap sensor. BlueprintCallable. This is spawned by default on every vehicle
FTransform | location to spawn sensor |
FOverlapSensorParameters* | Overlap sensor parameters |
Definition at line 209 of file SensorFactory.cpp.
References AOverlapSensor::Init().
Referenced by AVehicle::BeginPlay().
|
static |
Spawn new Radar sensor. BlueprintCallable.
FTransform | location to spawn sensor |
FString | Sensor's unique identifier |
FString | Sensor's name |
FRadarParameters | FRadarParameters parameters struct |
bool | Should the sensor start simulating after spawn |
Definition at line 165 of file SensorFactory.cpp.
References ARadar::Init().
|
static |
Spawn new Camera sensor. BlueprintCallable.
FTransform | location to spawn sensor |
FString | Sensor's unique identifier |
FString | Sensor's name |
FCameraBaseParameters | FCameraBaseParameters parameters struct |
bool | Should the sensor start simulating after spawn |
Definition at line 141 of file SensorFactory.cpp.
References SemanticSegmentationCamera.
|
staticprivate |
Definition at line 290 of file SensorFactory.cpp.
References SetSensorIdentifierAndNameWithFallbacks(), and SpawnModelClassForSensor().
|
static |
Spawn new Camera sensor. BlueprintCallable.
FTransform | location to spawn sensor |
FString | Sensor's unique identifier |
FString | Sensor's name |
FCameraBaseParameters | FCameraBaseParameters parameters struct |
bool | Should the sensor start simulating after spawn |
Definition at line 117 of file SensorFactory.cpp.
References ThermalCamera.
|
static |
Spawn new Tranform sensor. BlueprintCallable. This is spawned by default on every vehicle
FTransform | location to spawn sensor |
AActor* | Owning actor |
bool | Should the sensor start simulating after spawn |
Definition at line 193 of file SensorFactory.cpp.
References ATransformSensor::Init(), and FTransformSensorParameters::OwningActor.
Referenced by ASensor::BeginPlay(), APIDDrone::BeginPlay(), and AVehicle::BeginPlay().
|
staticprivate |
Sensor map data asset to hold sensor specific base data
Definition at line 214 of file SensorFactory.h.
Referenced by GetSensorMapDataAsset(), and Initialize().