42#include "Kismet/GameplayStatics.h"
43#include "Camera/PlayerCameraManager.h"
44#include "GenericPlatform/GenericPlatformFile.h"
45#include "Serialization/JsonSerializer.h"
46#include "Serialization/JsonWriter.h"
47#include "Misc/DefaultValueHelper.h"
48#include "HAL/PlatformFileManager.h"
49#include "GameFramework/Pawn.h"
50#include "Misc/FileHelper.h"
51#include "Dom/JsonObject.h"
52#include "GameFramework/PlayerController.h"
53#include "CollisionQueryParams.h"
54#include "Engine/GameViewportClient.h"
55#include "Engine/EngineTypes.h"
56#include "Engine/Engine.h"
57#include "Engine/World.h"
66 SimulatorLog::Log(
"SimulatorJsonParser: Spawning objects in main menu is disabled.");
70 if (!FPaths::FileExists(Path))
76 if (!FPaths::GetExtension(Path).Equals(TEXT(
"json"), ESearchCase::IgnoreCase))
78 SimulatorLog::Log(
"SimulatorJsonParser: Invalid file extension. Only .json files are supported.");
83 if (!FFileHelper::LoadFileToString(JsonString, *Path))
89 TSharedPtr<FJsonObject> RootJsonObject = MakeShareable(
new FJsonObject);
90 TSharedRef<TJsonReader<TCHAR>> Reader = TJsonReaderFactory<TCHAR>::Create(JsonString);
91 if (!FJsonSerializer::Deserialize(Reader, RootJsonObject))
97 const TArray<TSharedPtr<FJsonValue>>* JsonObjects;
98 if (!RootJsonObject->TryGetArrayField(
"objects", JsonObjects))
100 SimulatorLog::Log(
"json content doesn't contain 'objects' field. Make sure your json structure is correct.");
105 bool DataCapture =
false;
107 TArray<TSharedPtr<FJsonObject>> FilteredJsonObjects;
110 for (
const TSharedPtr<FJsonValue>& JsonObjectValue : *JsonObjects)
112 if (JsonObjectValue->Type != EJson::Object)
117 TSharedPtr<FJsonObject> JsonObject = JsonObjectValue->AsObject();
119 if (!JsonObject->TryGetStringField(
"type", ObjectType))
124 FilteredJsonObjects.Add(JsonObject);
125 if (ObjectType.Equals(
"sensor", ESearchCase::IgnoreCase))
129 else if (ObjectType.Equals(
"dataCapture", ESearchCase::IgnoreCase))
138 for (
const TSharedPtr<FJsonObject>& JsonObject : FilteredJsonObjects)
141 if (!JsonObject->TryGetStringField(
"type", ObjectType))
147 if (ObjectType.Equals(
"vehicle", ESearchCase::IgnoreCase))
151 if (ObjectType.Equals(
"spectator", ESearchCase::IgnoreCase))
155 else if (ObjectType.Equals(
"weather", ESearchCase::IgnoreCase))
159 else if (ObjectType.Equals(
"walker", ESearchCase::IgnoreCase))
163 else if (ObjectType.Equals(
"sensor", ESearchCase::IgnoreCase))
167 else if (ObjectType.Equals(
"prop", ESearchCase::IgnoreCase) || ObjectType.Equals(
"Foliage", ESearchCase::IgnoreCase))
171 else if (ObjectType.Equals(
"semanticColors", ESearchCase::IgnoreCase))
175 else if (ObjectType.Equals(
"commands", ESearchCase::IgnoreCase))
179 else if (ObjectType.Equals(
"volumeDeletion", ESearchCase::IgnoreCase))
183 else if (ObjectType.Equals(
"dataCapture", ESearchCase::IgnoreCase))
199 if (!JsonObject->TryGetStringField(
"model", Model))
206 JsonObject->TryGetStringField(
"name", Name);
207 JsonObject->TryGetStringField(
"id", ID);
213 FTransform SpawnTransform =
ParseTransform(
"spawnPoint", JsonObject);
215 bool DestroyCollidedObjectsOnSpawn =
false;
216 JsonObject->TryGetBoolField(
"destroyOverlappingObjects", DestroyCollidedObjectsOnSpawn);
237 const TArray<TSharedPtr<FJsonValue>>* SensorJsonObjects;
238 if (JsonObject->TryGetArrayField(
"sensors", SensorJsonObjects))
240 for (
const TSharedPtr<FJsonValue>& SensorValue : *SensorJsonObjects)
242 if (SensorValue->Type == EJson::Object)
244 TSharedPtr<FJsonObject> SensorJsonObject = SensorValue->AsObject();
254 if (!JsonObject->TryGetStringField(
"model", Model))
260 bool RandomZRotation =
false;
261 bool SnapToGround =
false;
262 JsonObject->TryGetBoolField(
"snap_to_ground", SnapToGround);
263 JsonObject->TryGetBoolField(
"random_z_rotation", RandomZRotation);
266 JsonObject->TryGetStringField(
"name", Name);
267 JsonObject->TryGetStringField(
"id", ID);
269 FTransform SpawnTransform =
ParseTransform(
"spawnPoint", JsonObject);
271 if (ObjectType.Equals(
"prop", ESearchCase::IgnoreCase))
276 else if (ObjectType.Equals(
"foliage", ESearchCase::IgnoreCase))
285 if (!
Vehicle || !SensorObject.IsValid())
290 USensorsManagerComponent* VehicleSensorManager =
Vehicle->GetSensorsManager();
291 if (!VehicleSensorManager)
296 TSharedPtr<FJsonObject> ParametersObject = SensorObject->GetObjectField(
"parameters");
297 if (!ParametersObject.IsValid())
303 FTransform RelativeTransform =
ParseTransform(
"spawnPoint", SensorObject);
306 FString SensorTypeString;
307 SensorObject->TryGetStringField(
"model", SensorTypeString);
312 FString SensorIdentifier, Name;
313 SensorObject->TryGetStringField(
"name", Name);
314 SensorObject->TryGetStringField(
"id", SensorIdentifier);
316 FString AttachedToComponent;
317 SensorObject->TryGetStringField(
"attachedToComponent", AttachedToComponent);
319 FString AttachedToBoneString;
320 FName AttachedToBone;
321 if (SensorObject->TryGetStringField(
"attachedToBone", AttachedToBoneString))
323 AttachedToBone = FName(*AttachedToBoneString);
328 USceneComponent* AttachToComponent = VehicleSensorManager->GetComponentByHierarchyName(AttachedToComponent);
334 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnLidar(RelativeTransform,
true, SensorIdentifier, Name, ParseParameters<FLidarParameters>(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
338 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnCamera(RelativeTransform,
true, SensorIdentifier, Name, ParseParameters<FCameraBaseParameters>(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
342 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnThermalCamera(RelativeTransform,
true, SensorIdentifier, Name, ParseParameters<FThermalCameraParameters>(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
346 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnDepthCamera(RelativeTransform,
true, SensorIdentifier, Name,
ParseDepthCameraParameters(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
350 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnRadar(RelativeTransform,
true, SensorIdentifier, Name, ParseParameters<FRadarParameters>(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
354 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnSegmentationCamera(RelativeTransform,
true, SensorIdentifier, Name, ParseParameters<FCameraBaseParameters>(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
358 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnDVSCamera(RelativeTransform,
true, SensorIdentifier, Name,
ParseDVSCameraParameters(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
368 if (!SensorObject.IsValid())
373 if (!SensorObject->HasField(
"parameters") || !SensorObject->HasField(
"model"))
378 TSharedPtr<FJsonObject> ParametersObject = SensorObject->GetObjectField(
"parameters");
379 if (!ParametersObject.IsValid())
384 FString SensorTypeString, SensorName, SensorIdentifier;
385 SensorObject->TryGetStringField(
"model", SensorTypeString);
386 SensorObject->TryGetStringField(
"name", SensorName);
387 SensorObject->TryGetStringField(
"id", SensorIdentifier);
389 FTransform SpawnTransform =
ParseTransform(
"spawnPoint", SensorObject);
391 AActor* ActorPtr =
nullptr;
394 UWorld* World =
nullptr;
396 if (GEngine && GEngine->GameViewport)
398 World = GEngine->GameViewport->GetWorld();
402 if (!SimulationLevelManager)
404 SimulatorLog::Log(
"Failed to spawn Sensor. Reason: Coulnd't to find SimulationLevelManager Actor!");
408 USensorsManagerComponent* WorldSensorManager = SimulationLevelManager->
GetSensorsManager();
409 if (!WorldSensorManager)
411 SimulatorLog::Log(
"Failed to spawn Sensor. Reason: Coulnd't to find USensorsManagerComponent Component!");
421 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnLidar(SpawnTransform,
false, SensorIdentifier, SensorName, ParseParameters<FLidarParameters>(ParametersObject),
true, TempActor,
nullptr, NAME_None));
425 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnRadar(SpawnTransform,
false, SensorIdentifier, SensorName, ParseParameters<FRadarParameters>(ParametersObject),
true, TempActor,
nullptr, NAME_None));
429 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnCamera(SpawnTransform,
false, SensorIdentifier, SensorName, ParseParameters<FCameraBaseParameters>(ParametersObject),
true, TempActor,
nullptr, NAME_None));
433 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnThermalCamera(SpawnTransform,
false, SensorIdentifier, SensorName,
ParseThermalCameraParameters(ParametersObject),
true, TempActor,
nullptr, NAME_None));
437 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnDepthCamera(SpawnTransform,
false, SensorIdentifier, SensorName,
ParseDepthCameraParameters(ParametersObject),
true, TempActor,
nullptr, NAME_None));
441 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnSegmentationCamera(SpawnTransform,
false, SensorIdentifier, SensorName, ParseParameters<FCameraBaseParameters>(ParametersObject),
true, TempActor,
nullptr, NAME_None));
445 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnDVSCamera(SpawnTransform,
false, SensorIdentifier, SensorName,
ParseDVSCameraParameters(ParametersObject),
true, TempActor,
nullptr, NAME_None));
454 ACamera* CameraPtr = Cast<ACamera>(ActorPtr);
461 bool AttachToSpectator =
false;
462 SensorObject->TryGetBoolField(
"attachToSpectator", AttachToSpectator);
464 if (AttachToSpectator)
476 if (!JsonObject.IsValid())
478 SimulatorLog::Log(
"SimulatorJsonParser failed to parse Walker json: Invalid JsonObject");
482 FString WalkerTypeString;
483 if (!JsonObject->TryGetStringField(
"model", WalkerTypeString))
485 SimulatorLog::Log(
"SimulatorJsonParser failed to parse Walker json: Model field is missing");
492 SimulatorLog::Log(
"SimulatorJsonParser failed to parse Walker json: Walker is None");
496 TSharedPtr<FJsonObject> ParametersObject = JsonObject->GetObjectField(
"parameters");
497 if (!ParametersObject.IsValid())
499 SimulatorLog::Log(
"SimulatorJsonParser failed to parse Walker json: ParametersObject is invalid or missing");
503 FString WalkerActionString;
504 if (!ParametersObject->TryGetStringField(
"walkerAction", WalkerActionString))
506 SimulatorLog::Log(
"SimulatorJsonParser failed to parse Walker json: walkerAction field is missing");
513 SimulatorLog::Log(
"SimulatorJsonParser failed to parse Walker json: Roaming Walker requires spawnPoint");
518 FString WalkerEndActionString;
519 ParametersObject->TryGetStringField(
"walkerEndAction", WalkerEndActionString);
534 ParametersObject->TryGetStringField(
"name", Name);
535 ParametersObject->TryGetStringField(
"id", ID);
538 bool StartAutomatically =
true;
539 if (ParametersObject->HasField(
"startAutomatically"))
541 ParametersObject->TryGetBoolField(
"startAutomatically", StartAutomatically);
554 if (ParametersObject->HasField(
"points"))
557 TSharedPtr<FJsonObject> PointsObject = ParametersObject->GetObjectField(
"points");
558 if (PointsObject.IsValid())
563 FString PointName = FString::Printf(TEXT(
"point%d"), PointIndex);
564 if (!PointsObject->HasField(PointName))
569 TSharedPtr<FJsonObject> PointObject = PointsObject->GetObjectField(PointName);
570 if (PointObject.IsValid())
572 FTransform PointTransform =
ParseTransform(PointName, PointsObject);
573 WalkerParams.
Points.Add(PointTransform);
580 else if (ParametersObject->HasField(
"spawnPoint"))
583 FTransform PointTransform =
ParseTransform(
"spawnPoint", ParametersObject);
584 WalkerParams.
Points.Add(PointTransform);
590 if (!JsonObject.IsValid())
595 TSharedPtr<FJsonObject> Parameters = JsonObject->GetObjectField(
"parameters");
596 if (Parameters.IsValid() && GEngine && GEngine->GameViewport)
598 UWorld* World = GEngine->GameViewport->GetWorld();
603 FJsonObjectConverter::JsonObjectToUStruct(Parameters.ToSharedRef(), FWeatherParameters::StaticStruct(), &Params);
630 if (!DronePtr || !JsonObject.IsValid())
635 TSharedPtr<FJsonObject> ParametersObject = JsonObject->GetObjectField(
"parameters");
637 if (ParametersObject.IsValid())
642 FString DroneActionObject = ParametersObject->GetStringField(
"droneAction");
643 if (!DroneActionObject.IsEmpty())
649 FString DroneEndActionObject = ParametersObject->GetStringField(
"droneEndAction");
650 if (!DroneEndActionObject.IsEmpty())
656 TSharedPtr<FJsonObject> PointsObject = ParametersObject->GetObjectField(
"points");
657 if (PointsObject.IsValid())
662 FString PointName = FString::Printf(TEXT(
"point%d"), PointIndex);
663 if (!PointsObject->HasField(PointName))
668 TSharedPtr<FJsonObject> PointObject = PointsObject->GetObjectField(PointName);
669 if (PointObject.IsValid())
671 FTransform PointTransform =
ParseTransform(PointName, PointsObject);
672 DroneParameters.
Points.Add(PointTransform);
684 if (!JsonObject.IsValid() || !Actor)
690 bool teleport =
false;
691 JsonObject->TryGetBoolField(
"followObject", follow);
692 JsonObject->TryGetBoolField(
"teleportSpectator", teleport);
694 if (!follow && !teleport)
700 if (GEngine && GEngine->GameViewport)
702 UWorld* World = GEngine->GameViewport->GetWorld();
708 AVehicle* VehiclePtr = Cast<AVehicle>(Actor);
712 if (SimulationLevelManager)
732 if (!ActorPtr || !GEngine || !GEngine->GameViewport)
737 UWorld* World = GEngine->GameViewport->GetWorld();
744 APlayerController* PlayerController = UGameplayStatics::GetPlayerController(World, 0);
745 if (PlayerController && Spectator)
747 APlayerCameraManager* CameraManager = PlayerController->PlayerCameraManager;
750 USceneComponent* CameraRootComponent = CameraManager->GetRootComponent();
751 if (CameraRootComponent)
754 ActorPtr->SetActorLocation(Spectator->GetActorLocation());
755 ActorPtr->SetActorRotation(Spectator->GetActorRotation());
758 ActorPtr->AttachToComponent(CameraRootComponent, FAttachmentTransformRules::SnapToTargetNotIncludingScale);
761 ASensor* SensorPtr = Cast<ASensor>(ActorPtr);
767 SensorModelPtr->Destroy();
777 UWorld* World =
nullptr;
778 if (GEngine && GEngine->GameViewport)
780 World = GEngine->GameViewport->GetWorld();
789 if (!CollectionInstance)
791 SimulatorLog::Log(
"ROSJsonParser.cpp: Failed to load MaterialParameterCollectionInstance!");
796 const TSharedPtr<FJsonObject>* ColorsObjectPtr =
nullptr;
797 if (JsonObject->TryGetObjectField(TEXT(
"colors"), ColorsObjectPtr) && ColorsObjectPtr !=
nullptr)
799 const TSharedPtr<FJsonObject>& ColorsObject = *ColorsObjectPtr;
800 for (
const auto& Elem : ColorsObject->Values)
802 FName Type = FName(*Elem.Key);
803 FString VectorString = Elem.Value->AsString();
806 FVector4 ParsedVector;
807 TArray<FString> ParsedValues;
808 VectorString.ParseIntoArray(ParsedValues, TEXT(
","),
true);
809 if (ParsedValues.Num() == 4)
811 ParsedVector.X = FCString::Atof(*ParsedValues[0]);
812 ParsedVector.Y = FCString::Atof(*ParsedValues[1]);
813 ParsedVector.Z = FCString::Atof(*ParsedValues[2]);
814 ParsedVector.W = FCString::Atof(*ParsedValues[3]);
827 if (!GEngine || !GEngine->GameViewport)
832 UWorld* World = GEngine->GameViewport->GetWorld();
835 const TArray<TSharedPtr<FJsonValue>>* CommandsArray;
836 if (JsonObject->TryGetArrayField(TEXT(
"commands"), CommandsArray))
838 for (
const TSharedPtr<FJsonValue>& CommandValue : *CommandsArray)
841 if (CommandValue->TryGetString(Command))
843 GEngine->Exec(World, *Command);
852 if (!GEngine || !GEngine->GameViewport || !JsonObject.IsValid())
858 FTransform SpawnTransform =
ParseTransform(
"spawnPoint", JsonObject);
861 FTransform TransformBounds =
ParseTransform(
"bounds", JsonObject);
862 FVector Bounds = TransformBounds.GetLocation();
864 bool OnlyDestroyTrees =
true;
865 JsonObject->TryGetBoolField(TEXT(
"onlyDestroyTrees"), OnlyDestroyTrees);
867 UWorld* World = GEngine->GameViewport->GetWorld();
885 if (!JsonObject.IsValid() || !GEngine || !GEngine->GameViewport)
891 TSharedPtr<FJsonObject> ParametersObject = JsonObject->GetObjectField(
"parameters");
892 if (ParametersObject.IsValid())
894 TSharedPtr<FJsonObject> PointsObject = ParametersObject->GetObjectField(
"points");
895 if (PointsObject.IsValid())
900 FString PointName = FString::Printf(TEXT(
"point%d"), PointIndex);
901 if (!PointsObject->HasField(PointName))
906 TSharedPtr<FJsonObject> PointObject = PointsObject->GetObjectField(PointName);
907 if (PointObject.IsValid())
909 FTransform PointTransform =
ParseTransform(PointName, PointsObject);
918 UWorld* World = GEngine->GameViewport->GetWorld();
929 FTransform SpawnTransform;
931 const TSharedPtr<FJsonObject>* SpawnPointObject =
nullptr;
932 if (Object->TryGetObjectField(FieldName, SpawnPointObject))
934 UE_LOG(LogTemp, Warning, TEXT(
"Parsing transform!"))
935 double LocationX = 0.0, LocationY = 0.0, LocationZ = 0.0;
936 double Yaw = 0.0, Pitch = 0.0, Roll = 0.0;
938 auto& SPO = *SpawnPointObject->Get();
941 bool HasLocation = SPO.TryGetNumberField(TEXT(
"x"), LocationX) && SPO.TryGetNumberField(TEXT(
"y"), LocationY) && SPO.TryGetNumberField(TEXT(
"z"), LocationZ);
944 SPO.TryGetNumberField(TEXT(
"yaw"), Yaw);
945 SPO.TryGetNumberField(TEXT(
"pitch"), Pitch);
946 SPO.TryGetNumberField(TEXT(
"roll"), Roll);
950 bool ChangeScale =
false;
951 if (SPO.HasField(
"scaleX") && SPO.HasField(
"scaleY") && SPO.HasField(
"scaleZ"))
954 SPO.TryGetNumberField(TEXT(
"scaleX"), Scale.X);
955 SPO.TryGetNumberField(TEXT(
"scaleY"), Scale.Y);
956 SPO.TryGetNumberField(TEXT(
"scaleZ"), Scale.Z);
961 UE_LOG(LogTemp, Warning, TEXT(
"Has Location!"))
962 FVector Location(LocationX, LocationY, LocationZ);
963 FRotator Rotation(Pitch, Yaw, Roll);
965 SpawnTransform.SetLocation(Location);
966 SpawnTransform.SetRotation(Rotation.Quaternion());
970 SpawnTransform.SetScale3D(Scale);
975 return SpawnTransform;
981 const TSharedPtr<FJsonObject>* VectorObject;
983 if (Object->TryGetObjectField(FieldName, VectorObject))
986 (*VectorObject)->TryGetNumberField(TEXT(
"x"), X);
987 (*VectorObject)->TryGetNumberField(TEXT(
"y"), Y);
988 (*VectorObject)->TryGetNumberField(TEXT(
"z"), Z);
989 (*VectorObject)->TryGetNumberField(TEXT(
"w"), W);
990 Vector = FVector4(X, Y, Z, W);
1000 if (ParametersObject.IsValid())
1002 FJsonObjectConverter::JsonObjectToUStruct(ParametersObject.ToSharedRef(), FDepthCameraParameters::StaticStruct(), &DepthCameraParams);
1005 return DepthCameraParams;
1012 if (ParametersObject.IsValid())
1018 ParametersObject->TryGetNumberField(TEXT(
"widthResolutionNoise"), ThermalCameraParams.
WidthResolutionNoise);
1019 ParametersObject->TryGetNumberField(TEXT(
"heightResolutionNoise"), ThermalCameraParams.
HeightResolutionNoise);
1022 TSharedPtr<FJsonObject> CameraParametersObject = ParametersObject->GetObjectField(
"cameraParameters");
1023 if (CameraParametersObject.IsValid())
1025 ThermalCameraParams.
CameraParameters = ParseParameters<FCameraBaseParameters>(CameraParametersObject);
1029 return ThermalCameraParams;
1036 if (ParametersObject.IsValid())
1038 FJsonObjectConverter::JsonObjectToUStruct(ParametersObject.ToSharedRef(), FDVSCameraParameters::StaticStruct(), &DVSCameraParams);
1041 return DVSCameraParams;
1046 int Value = Default;
1048 if (JsonObject.IsValid() && JsonObject->HasField(FieldName))
1050 JsonObject->TryGetNumberField(FieldName, Value);
@ SemanticSegmentationCamera
static EDroneEndAction GetDroneEndAction(FString endActionstring)
static EDroneAction GetDroneAction(FString actionstring)
void DestroyOverlappingActors(bool OnlyTrees)
void ChangeOverlapBounds(FVector Bounds)
void ChangeDroneParameters(const FDroneParameters &newParameters)
void SetupPhotoCapture(FCaptureData NewCaptureData)
ASensorModel * GetSensorModel() const
bool TakeManualControlOfVehicle(AVehicle *Vehicle)
USensorsManagerComponent * GetSensorsManager() const
void TeleportSpectator(const FTransform &Transform)
void UpdateWeather(const FWeatherParameters &WeatherParameters, bool updateToROS)
const FWeatherParameters & GetCurrentWeather() const
static void Log(const FString &Message, bool LogToTextFile=true, bool LogToROS=true)
static bool IsPlayingInMainMenu()
static ASpectator * GetSpectator(const UObject *WorldContextObject)
static AWeather * GetWeatherActor(const UObject *WorldContextObject)
static ASimulationLevelManager * GetSimulationLevelManager(const UObject *WorldContextObject)
static AVehicle * SpawnVehicle(EVehicleTypes VehicleType, FTransform SpawnTransform, const FString &ActorName, const FString &ActorID, bool SnapAboveGround=false, float AboveOffset=150.0f, bool DestroyOverlappingActors=false)
static AActor * SpawnProp(EPropTypes PropType, FTransform Transform, FString ActorName="", FString ActorID="", bool RandomZRotation=false, bool SnapToGround=false)
static AWalker * SpawnWalker(FWalkerParameters Parameters, const FString &ActorName="", const FString &ActorID="", bool StartAutomatically=true)
static AActor * SpawnFoliage(EFoliageTypes FoliageType, FTransform Transform, FString ActorName="", FString ActorID="", bool RandomZRotation=true, bool SnapToGround=true)
static EWalkerEndAction ConvertStringToWalkerEndActionType(const FString &String)
static ESensorTypes ConvertStringToSensorType(const FString &String)
static EWalkerAction ConvertStringToWalkerActionType(const FString &String)
static EVehicleTypes ConvertStringToVehicleType(const FString &String)
static EWalkerType ConvertStringToWalkerType(const FString &String)
static EPropTypes ConvertStringToPropType(const FString &String)
static EFoliageTypes ConvertStringToFoliageType(const FString &String)
static bool UpdateMaterialCollectionVectorValue(UMaterialParameterCollectionInstance *MPCInstance, const FName ParameterName, const FVector4 Value)
static UMaterialParameterCollectionInstance * LoadMaterialParameterCollectionInstance(const UObject *WorldContextObject, const FString &Path)
static void TeleportSpectatorOrFollowActorIfField(const TSharedPtr< FJsonObject > &JsonObject, AActor *Actor, const FTransform &Transform)
static TArray< ACamera * > SpawnedCameras
static FTransform ParseTransform(const FString &FieldName, const TSharedPtr< FJsonObject > &Object)
static int GetIntValueOrDefault(const TSharedPtr< FJsonObject > &JsonObject, const FString &FieldName, int Default)
static FVector4 ParseVector4(const FString &FieldName, const TSharedPtr< FJsonObject > &Object)
static FDVSCameraParameters ParseDVSCameraParameters(const TSharedPtr< FJsonObject > &ParametersObject)
static void ParseAndSetDroneParameters(APIDDrone *DronePtr, const TSharedPtr< FJsonObject > &JsonObject)
static void ParseAndOperateJSONFile(const FString &Path)
static FThermalCameraParameters ParseThermalCameraParameters(const TSharedPtr< FJsonObject > &ParametersObject)
static void AttachActorToSpectatorCamera(AActor *ActorPtr)
static bool IsDataCapture
static void ParsePropOrFoliage(const TSharedPtr< FJsonObject > &JsonObject, const FString &ObjectType)
static void ParseVehicle(const TSharedPtr< FJsonObject > &JsonObject)
static void ParseVolumeDeletion(const TSharedPtr< FJsonObject > &JsonObject)
static void ParseDataCapture(const TSharedPtr< FJsonObject > &JsonObject)
static void ParseWalkerSpawnPoints(const TSharedPtr< FJsonObject > &ParametersObject, FWalkerParameters &WalkerParams)
static void ParseCommands(const TSharedPtr< FJsonObject > &JsonObject)
static FDepthCameraParameters ParseDepthCameraParameters(const TSharedPtr< FJsonObject > &ParametersObject)
static void ParseAndSetSemanticColors(const TSharedPtr< FJsonObject > &JsonObject)
static void ChangeWeather(const TSharedPtr< FJsonObject > &JsonObject)
static void SpawnWalker(const TSharedPtr< FJsonObject > &JsonObject)
static void SpawnSensorWorld(const TSharedPtr< FJsonObject > &SensorObject)
static void SpawnSensorToVehicle(AVehicle *Vehicle, const TSharedPtr< FJsonObject > &SensorObject)
TArray< FTransform > CapturePositions
TArray< ACamera * > Cameras
EDroneEndAction DroneEndAction
TArray< FTransform > Points
int32 WidthResolutionNoise
int32 HeightResolutionNoise
FCameraBaseParameters CameraParameters
bool AllowCustomNoiseResolution
EWalkerAction WalkerAction
TArray< FTransform > Points
EWalkerEndAction WalkerEndAction