41#include "Kismet/GameplayStatics.h"
42#include "Camera/PlayerCameraManager.h"
43#include "GenericPlatform/GenericPlatformFile.h"
44#include "Serialization/JsonSerializer.h"
45#include "Serialization/JsonWriter.h"
46#include "Misc/DefaultValueHelper.h"
47#include "HAL/PlatformFileManager.h"
48#include "GameFramework/Pawn.h"
49#include "Misc/FileHelper.h"
50#include "Dom/JsonObject.h"
51#include "GameFramework/PlayerController.h"
52#include "CollisionQueryParams.h"
53#include "Engine/GameViewportClient.h"
54#include "Engine/EngineTypes.h"
55#include "Engine/Engine.h"
56#include "Engine/World.h"
62 SimulatorLog::Log(
"SimulatorJsonParser: Spawning objects in main menu is disabled.");
66 if (!FPaths::FileExists(Path))
72 if (!FPaths::GetExtension(Path).Equals(TEXT(
"json"), ESearchCase::IgnoreCase))
74 SimulatorLog::Log(
"SimulatorJsonParser: Invalid file extension. Only .json files are supported.");
79 if (!FFileHelper::LoadFileToString(JsonString, *Path))
85 TSharedPtr<FJsonObject> RootJsonObject = MakeShareable(
new FJsonObject);
86 TSharedRef<TJsonReader<TCHAR>> Reader = TJsonReaderFactory<TCHAR>::Create(JsonString);
87 if (!FJsonSerializer::Deserialize(Reader, RootJsonObject))
93 const TArray<TSharedPtr<FJsonValue>>* JsonObjects;
94 if (!RootJsonObject->TryGetArrayField(
"objects", JsonObjects))
96 SimulatorLog::Log(
"json content doesn't contain 'objects' field. Make sure your json structure is correct.");
101 for (
const TSharedPtr<FJsonValue>& JsonObjectValue : *JsonObjects)
103 if (JsonObjectValue->Type != EJson::Object)
108 TSharedPtr<FJsonObject> JsonObject = JsonObjectValue->AsObject();
110 if (!JsonObject->TryGetStringField(
"type", ObjectType))
116 if (ObjectType.Equals(
"vehicle", ESearchCase::IgnoreCase))
120 if (ObjectType.Equals(
"spectator", ESearchCase::IgnoreCase))
124 else if (ObjectType.Equals(
"weather", ESearchCase::IgnoreCase))
128 else if (ObjectType.Equals(
"walker", ESearchCase::IgnoreCase))
132 else if (ObjectType.Equals(
"sensor", ESearchCase::IgnoreCase))
136 else if (ObjectType.Equals(
"prop", ESearchCase::IgnoreCase) || ObjectType.Equals(
"Foliage", ESearchCase::IgnoreCase))
140 else if (ObjectType.Equals(
"semanticColors", ESearchCase::IgnoreCase))
144 else if (ObjectType.Equals(
"commands", ESearchCase::IgnoreCase))
148 else if (ObjectType.Equals(
"volumeDeletion", ESearchCase::IgnoreCase))
158 if (!JsonObject->TryGetStringField(
"model", Model))
165 JsonObject->TryGetStringField(
"name", Name);
166 JsonObject->TryGetStringField(
"id", ID);
172 FTransform SpawnTransform =
ParseTransform(
"spawnPoint", JsonObject);
174 bool DestroyCollidedObjectsOnSpawn =
false;
175 JsonObject->TryGetBoolField(
"destroyOverlappingObjects", DestroyCollidedObjectsOnSpawn);
196 const TArray<TSharedPtr<FJsonValue>>* SensorJsonObjects;
197 if (JsonObject->TryGetArrayField(
"sensors", SensorJsonObjects))
199 for (
const TSharedPtr<FJsonValue>& SensorValue : *SensorJsonObjects)
201 if (SensorValue->Type == EJson::Object)
203 TSharedPtr<FJsonObject> SensorJsonObject = SensorValue->AsObject();
213 if (!JsonObject->TryGetStringField(
"model", Model))
219 bool RandomZRotation =
false;
220 bool SnapToGround =
false;
221 JsonObject->TryGetBoolField(
"snap_to_ground", SnapToGround);
222 JsonObject->TryGetBoolField(
"random_z_rotation", RandomZRotation);
225 JsonObject->TryGetStringField(
"name", Name);
226 JsonObject->TryGetStringField(
"id", ID);
228 FTransform SpawnTransform =
ParseTransform(
"spawnPoint", JsonObject);
230 if (ObjectType.Equals(
"prop", ESearchCase::IgnoreCase))
235 else if (ObjectType.Equals(
"foliage", ESearchCase::IgnoreCase))
244 if (!
Vehicle || !SensorObject.IsValid())
249 USensorsManagerComponent* VehicleSensorManager =
Vehicle->GetSensorsManager();
250 if (!VehicleSensorManager)
255 TSharedPtr<FJsonObject> ParametersObject = SensorObject->GetObjectField(
"parameters");
256 if (!ParametersObject.IsValid())
262 FTransform RelativeTransform =
ParseTransform(
"spawnPoint", SensorObject);
265 FString SensorTypeString;
266 SensorObject->TryGetStringField(
"model", SensorTypeString);
271 FString SensorIdentifier, Name;
272 SensorObject->TryGetStringField(
"name", Name);
273 SensorObject->TryGetStringField(
"id", SensorIdentifier);
275 FString AttachedToComponent;
276 SensorObject->TryGetStringField(
"attachedToComponent", AttachedToComponent);
278 FString AttachedToBoneString;
279 FName AttachedToBone;
280 if (SensorObject->TryGetStringField(
"attachedToBone", AttachedToBoneString))
282 AttachedToBone = FName(*AttachedToBoneString);
287 USceneComponent* AttachToComponent = VehicleSensorManager->GetComponentByHierarchyName(AttachedToComponent);
293 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnLidar(RelativeTransform,
true, SensorIdentifier, Name, ParseParameters<FLidarParameters>(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
297 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnCamera(RelativeTransform,
true, SensorIdentifier, Name, ParseParameters<FCameraBaseParameters>(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
301 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnThermalCamera(RelativeTransform,
true, SensorIdentifier, Name, ParseParameters<FThermalCameraParameters>(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
305 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnDepthCamera(RelativeTransform,
true, SensorIdentifier, Name,
ParseDepthCameraParameters(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
309 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnRadar(RelativeTransform,
true, SensorIdentifier, Name, ParseParameters<FRadarParameters>(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
313 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnSegmentationCamera(RelativeTransform,
true, SensorIdentifier, Name, ParseParameters<FCameraBaseParameters>(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
317 SensorPtr = Cast<ASensor>(VehicleSensorManager->SpawnDVSCamera(RelativeTransform,
true, SensorIdentifier, Name,
ParseDVSCameraParameters(ParametersObject),
true, TempActor, AttachToComponent, AttachedToBone));
327 if (!SensorObject.IsValid())
332 if (!SensorObject->HasField(
"parameters") || !SensorObject->HasField(
"model"))
337 TSharedPtr<FJsonObject> ParametersObject = SensorObject->GetObjectField(
"parameters");
338 if (!ParametersObject.IsValid())
343 FString SensorTypeString, SensorName, SensorIdentifier;
344 SensorObject->TryGetStringField(
"model", SensorTypeString);
345 SensorObject->TryGetStringField(
"name", SensorName);
346 SensorObject->TryGetStringField(
"id", SensorIdentifier);
348 FTransform SpawnTransform =
ParseTransform(
"spawnPoint", SensorObject);
350 AActor* ActorPtr =
nullptr;
353 UWorld* World =
nullptr;
355 if (GEngine && GEngine->GameViewport)
357 World = GEngine->GameViewport->GetWorld();
361 if (!SimulationLevelManager)
363 SimulatorLog::Log(
"Failed to spawn Sensor. Reason: Coulnd't to find SimulationLevelManager Actor!");
367 USensorsManagerComponent* WorldSensorManager = SimulationLevelManager->
GetSensorsManager();
368 if (!WorldSensorManager)
370 SimulatorLog::Log(
"Failed to spawn Sensor. Reason: Coulnd't to find USensorsManagerComponent Component!");
380 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnLidar(SpawnTransform,
false, SensorIdentifier, SensorName, ParseParameters<FLidarParameters>(ParametersObject),
true, TempActor,
nullptr, NAME_None));
384 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnRadar(SpawnTransform,
false, SensorIdentifier, SensorName, ParseParameters<FRadarParameters>(ParametersObject),
true, TempActor,
nullptr, NAME_None));
388 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnCamera(SpawnTransform,
false, SensorIdentifier, SensorName, ParseParameters<FCameraBaseParameters>(ParametersObject),
true, TempActor,
nullptr, NAME_None));
392 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnThermalCamera(SpawnTransform,
false, SensorIdentifier, SensorName,
ParseThermalCameraParameters(ParametersObject),
true, TempActor,
nullptr, NAME_None));
396 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnDepthCamera(SpawnTransform,
false, SensorIdentifier, SensorName,
ParseDepthCameraParameters(ParametersObject),
true, TempActor,
nullptr, NAME_None));
400 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnSegmentationCamera(SpawnTransform,
false, SensorIdentifier, SensorName, ParseParameters<FCameraBaseParameters>(ParametersObject),
true, TempActor,
nullptr, NAME_None));
404 ActorPtr = Cast<AActor>(WorldSensorManager->SpawnDVSCamera(SpawnTransform,
false, SensorIdentifier, SensorName,
ParseDVSCameraParameters(ParametersObject),
true, TempActor,
nullptr, NAME_None));
411 bool AttachToSpectator =
false;
412 SensorObject->TryGetBoolField(
"attachToSpectator", AttachToSpectator);
414 if (AttachToSpectator)
426 if (!JsonObject.IsValid())
428 SimulatorLog::Log(
"SimulatorJsonParser failed to parse Walker json: Invalid JsonObject");
432 FString WalkerTypeString;
433 if (!JsonObject->TryGetStringField(
"model", WalkerTypeString))
435 SimulatorLog::Log(
"SimulatorJsonParser failed to parse Walker json: Model field is missing");
442 SimulatorLog::Log(
"SimulatorJsonParser failed to parse Walker json: Walker is None");
446 TSharedPtr<FJsonObject> ParametersObject = JsonObject->GetObjectField(
"parameters");
447 if (!ParametersObject.IsValid())
449 SimulatorLog::Log(
"SimulatorJsonParser failed to parse Walker json: ParametersObject is invalid or missing");
453 FString WalkerActionString;
454 if (!ParametersObject->TryGetStringField(
"walkerAction", WalkerActionString))
456 SimulatorLog::Log(
"SimulatorJsonParser failed to parse Walker json: walkerAction field is missing");
463 SimulatorLog::Log(
"SimulatorJsonParser failed to parse Walker json: Roaming Walker requires spawnPoint");
468 FString WalkerEndActionString;
469 ParametersObject->TryGetStringField(
"walkerEndAction", WalkerEndActionString);
484 ParametersObject->TryGetStringField(
"name", Name);
485 ParametersObject->TryGetStringField(
"id", ID);
488 bool StartAutomatically =
true;
489 if (ParametersObject->HasField(
"startAutomatically"))
491 ParametersObject->TryGetBoolField(
"startAutomatically", StartAutomatically);
504 if (ParametersObject->HasField(
"points"))
507 TSharedPtr<FJsonObject> PointsObject = ParametersObject->GetObjectField(
"points");
508 if (PointsObject.IsValid())
513 FString PointName = FString::Printf(TEXT(
"point%d"), PointIndex);
514 if (!PointsObject->HasField(PointName))
519 TSharedPtr<FJsonObject> PointObject = PointsObject->GetObjectField(PointName);
520 if (PointObject.IsValid())
522 FTransform PointTransform =
ParseTransform(PointName, PointsObject);
523 WalkerParams.
Points.Add(PointTransform);
530 else if (ParametersObject->HasField(
"spawnPoint"))
533 FTransform PointTransform =
ParseTransform(
"spawnPoint", ParametersObject);
534 WalkerParams.
Points.Add(PointTransform);
540 if (!JsonObject.IsValid())
545 TSharedPtr<FJsonObject> Parameters = JsonObject->GetObjectField(
"parameters");
546 if (Parameters.IsValid() && GEngine && GEngine->GameViewport)
548 UWorld* World = GEngine->GameViewport->GetWorld();
553 FJsonObjectConverter::JsonObjectToUStruct(Parameters.ToSharedRef(), FWeatherParameters::StaticStruct(), &Params);
561 if (!DronePtr || !JsonObject.IsValid())
566 TSharedPtr<FJsonObject> ParametersObject = JsonObject->GetObjectField(
"parameters");
568 if (ParametersObject.IsValid())
571 FJsonObjectConverter::JsonObjectToUStruct(ParametersObject.ToSharedRef(), FDroneParameters::StaticStruct(), &DroneParameters);
573 TSharedPtr<FJsonObject> PointsObject = ParametersObject->GetObjectField(
"points");
574 if (PointsObject.IsValid())
579 FString PointName = FString::Printf(TEXT(
"point%d"), PointIndex);
580 if (!PointsObject->HasField(PointName))
585 TSharedPtr<FJsonObject> PointObject = PointsObject->GetObjectField(PointName);
586 if (PointObject.IsValid())
588 FTransform PointTransform =
ParseTransform(PointName, PointObject);
589 DroneParameters.
Points.Add(PointTransform);
602 if (!JsonObject.IsValid() || !Actor)
608 bool teleport =
false;
609 JsonObject->TryGetBoolField(
"followObject", follow);
610 JsonObject->TryGetBoolField(
"teleportSpectator", teleport);
612 if (!follow && !teleport)
618 if (GEngine && GEngine->GameViewport)
620 UWorld* World = GEngine->GameViewport->GetWorld();
626 AVehicle* VehiclePtr = Cast<AVehicle>(Actor);
630 if (SimulationLevelManager)
650 if (!ActorPtr || !GEngine || !GEngine->GameViewport)
655 UWorld* World = GEngine->GameViewport->GetWorld();
662 APlayerController* PlayerController = UGameplayStatics::GetPlayerController(World, 0);
663 if (PlayerController && Spectator)
665 APlayerCameraManager* CameraManager = PlayerController->PlayerCameraManager;
668 USceneComponent* CameraRootComponent = CameraManager->GetRootComponent();
669 if (CameraRootComponent)
672 ActorPtr->SetActorLocation(Spectator->GetActorLocation());
673 ActorPtr->SetActorRotation(Spectator->GetActorRotation());
676 ActorPtr->AttachToComponent(CameraRootComponent, FAttachmentTransformRules::SnapToTargetNotIncludingScale);
679 ASensor* SensorPtr = Cast<ASensor>(ActorPtr);
685 SensorModelPtr->Destroy();
695 UWorld* World =
nullptr;
696 if (GEngine && GEngine->GameViewport)
698 World = GEngine->GameViewport->GetWorld();
707 if (!CollectionInstance)
709 SimulatorLog::Log(
"ROSJsonParser.cpp: Failed to load MaterialParameterCollectionInstance!");
714 const TSharedPtr<FJsonObject>* ColorsObjectPtr =
nullptr;
715 if (JsonObject->TryGetObjectField(TEXT(
"colors"), ColorsObjectPtr) && ColorsObjectPtr !=
nullptr)
717 const TSharedPtr<FJsonObject>& ColorsObject = *ColorsObjectPtr;
718 for (
const auto& Elem : ColorsObject->Values)
720 FName Type = FName(*Elem.Key);
721 FString VectorString = Elem.Value->AsString();
724 FVector4 ParsedVector;
725 TArray<FString> ParsedValues;
726 VectorString.ParseIntoArray(ParsedValues, TEXT(
","),
true);
727 if (ParsedValues.Num() == 4)
729 ParsedVector.X = FCString::Atof(*ParsedValues[0]);
730 ParsedVector.Y = FCString::Atof(*ParsedValues[1]);
731 ParsedVector.Z = FCString::Atof(*ParsedValues[2]);
732 ParsedVector.W = FCString::Atof(*ParsedValues[3]);
745 if (!GEngine || !GEngine->GameViewport)
750 UWorld* World = GEngine->GameViewport->GetWorld();
753 const TArray<TSharedPtr<FJsonValue>>* CommandsArray;
754 if (JsonObject->TryGetArrayField(TEXT(
"commands"), CommandsArray))
756 for (
const TSharedPtr<FJsonValue>& CommandValue : *CommandsArray)
759 if (CommandValue->TryGetString(Command))
761 GEngine->Exec(World, *Command);
770 if (!GEngine || !GEngine->GameViewport || !JsonObject.IsValid())
776 FTransform SpawnTransform =
ParseTransform(
"spawnPoint", JsonObject);
779 FTransform TransformBounds =
ParseTransform(
"bounds", JsonObject);
780 FVector Bounds = TransformBounds.GetLocation();
782 bool OnlyDestroyTrees =
true;
783 JsonObject->TryGetBoolField(TEXT(
"onlyDestroyTrees"), OnlyDestroyTrees);
785 UWorld* World = GEngine->GameViewport->GetWorld();
803 FTransform SpawnTransform;
805 const TSharedPtr<FJsonObject>* SpawnPointObject =
nullptr;
806 if (Object->TryGetObjectField(FieldName, SpawnPointObject))
808 double LocationX = 0.0, LocationY = 0.0, LocationZ = 0.0;
809 double Yaw = 0.0, Pitch = 0.0, Roll = 0.0;
811 auto& SPO = *SpawnPointObject->Get();
814 bool HasLocation = SPO.TryGetNumberField(TEXT(
"x"), LocationX) && SPO.TryGetNumberField(TEXT(
"y"), LocationY) && SPO.TryGetNumberField(TEXT(
"z"), LocationZ);
817 SPO.TryGetNumberField(TEXT(
"yaw"), Yaw);
818 SPO.TryGetNumberField(TEXT(
"pitch"), Pitch);
819 SPO.TryGetNumberField(TEXT(
"roll"), Roll);
823 bool ChangeScale =
false;
824 if (SPO.HasField(
"scaleX") && SPO.HasField(
"scaleY") && SPO.HasField(
"scaleZ"))
827 SPO.TryGetNumberField(TEXT(
"scaleX"), Scale.X);
828 SPO.TryGetNumberField(TEXT(
"scaleY"), Scale.Y);
829 SPO.TryGetNumberField(TEXT(
"scaleZ"), Scale.Z);
834 FVector Location(LocationX, LocationY, LocationZ);
835 FRotator Rotation(Pitch, Yaw, Roll);
837 SpawnTransform.SetLocation(Location);
838 SpawnTransform.SetRotation(Rotation.Quaternion());
842 SpawnTransform.SetScale3D(Scale);
847 return SpawnTransform;
853 const TSharedPtr<FJsonObject>* VectorObject;
855 if (Object->TryGetObjectField(FieldName, VectorObject))
858 (*VectorObject)->TryGetNumberField(TEXT(
"x"), X);
859 (*VectorObject)->TryGetNumberField(TEXT(
"y"), Y);
860 (*VectorObject)->TryGetNumberField(TEXT(
"z"), Z);
861 (*VectorObject)->TryGetNumberField(TEXT(
"w"), W);
862 Vector = FVector4(X, Y, Z, W);
872 if (ParametersObject.IsValid())
874 FJsonObjectConverter::JsonObjectToUStruct(ParametersObject.ToSharedRef(), FDepthCameraParameters::StaticStruct(), &DepthCameraParams);
877 return DepthCameraParams;
884 if (ParametersObject.IsValid())
890 ParametersObject->TryGetNumberField(TEXT(
"widthResolutionNoise"), ThermalCameraParams.
WidthResolutionNoise);
891 ParametersObject->TryGetNumberField(TEXT(
"heightResolutionNoise"), ThermalCameraParams.
HeightResolutionNoise);
894 TSharedPtr<FJsonObject> CameraParametersObject = ParametersObject->GetObjectField(
"cameraParameters");
895 if (CameraParametersObject.IsValid())
897 ThermalCameraParams.
CameraParameters = ParseParameters<FCameraBaseParameters>(CameraParametersObject);
901 return ThermalCameraParams;
908 if (ParametersObject.IsValid())
910 FJsonObjectConverter::JsonObjectToUStruct(ParametersObject.ToSharedRef(), FDVSCameraParameters::StaticStruct(), &DVSCameraParams);
913 return DVSCameraParams;
920 if (JsonObject.IsValid() && JsonObject->HasField(FieldName))
922 JsonObject->TryGetNumberField(FieldName, Value);
@ SemanticSegmentationCamera
void DestroyOverlappingActors(bool OnlyTrees)
void ChangeOverlapBounds(FVector Bounds)
void ChangeDroneParameters(const FDroneParameters &newParameters)
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 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 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 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 > Points
int32 WidthResolutionNoise
int32 HeightResolutionNoise
FCameraBaseParameters CameraParameters
bool AllowCustomNoiseResolution
EWalkerAction WalkerAction
TArray< FTransform > Points
EWalkerEndAction WalkerEndAction