8#include "CoreMinimal.h"
9#include "EngineMinimal.h"
10#include "Kismet/BlueprintFunctionLibrary.h"
11#include "GameFramework/Actor.h"
14#include "JsonUtilities.h"
15#include "JsonObjectConverter.h"
17#include "SimulatorJsonParser.generated.h"
45 UFUNCTION(BlueprintCallable, Category =
"ROS JSON Utilities")
46 static void ParseAndOperateJSONFile(
const FString& Path);
50 static void ParseVehicle(
const TSharedPtr<FJsonObject>& JsonObject);
52 static void ParsePropOrFoliage(
const TSharedPtr<FJsonObject>& JsonObject,
const FString& ObjectType);
54 static void SpawnSensorToVehicle(
AVehicle*
Vehicle,
const TSharedPtr<FJsonObject>& SensorObject);
56 static void SpawnSensorWorld(
const TSharedPtr<FJsonObject>& SensorObject);
58 static void SpawnWalker(
const TSharedPtr<FJsonObject>& JsonObject);
60 static void ParseWalkerSpawnPoints(
const TSharedPtr<FJsonObject>& ParametersObject,
FWalkerParameters& WalkerParams);
62 static void ChangeWeather(
const TSharedPtr<FJsonObject>& JsonObject);
64 static void ParseAndSetDroneParameters(
APIDDrone* DronePtr,
const TSharedPtr<FJsonObject>& JsonObject);
66 static void TeleportSpectatorOrFollowActorIfField(
const TSharedPtr<FJsonObject>& JsonObject, AActor* Actor,
const FTransform&
Transform);
68 static void AttachActorToSpectatorCamera(AActor* ActorPtr);
70 static void ParseAndSetSemanticColors(
const TSharedPtr<FJsonObject>& JsonObject);
72 static void ParseCommands(
const TSharedPtr<FJsonObject>& JsonObject);
74 static void ParseVolumeDeletion(
const TSharedPtr<FJsonObject>& JsonObject);
76 static void ParseDataCapture(
const TSharedPtr<FJsonObject>& JsonObject);
78 static FTransform ParseTransform(
const FString& FieldName,
const TSharedPtr<FJsonObject>& Object);
80 static FVector4 ParseVector4(
const FString& FieldName,
const TSharedPtr<FJsonObject>& Object);
86 static FDVSCameraParameters ParseDVSCameraParameters(
const TSharedPtr<FJsonObject>& ParametersObject);
88 static int GetIntValueOrDefault(
const TSharedPtr<FJsonObject>& JsonObject,
const FString& FieldName,
int Default);
101 if (ParametersObject.IsValid())
103 FJsonObjectConverter::JsonObjectToUStruct(ParametersObject.ToSharedRef(), T::StaticStruct(), &Params);
static TArray< ACamera * > SpawnedCameras
static T ParseParameters(const TSharedPtr< FJsonObject > &ParametersObject)
static bool IsDataCapture