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"
44 UFUNCTION(BlueprintCallable, Category =
"ROS JSON Utilities")
45 static void ParseAndOperateJSONFile(
const FString& Path);
49 static void ParseVehicle(
const TSharedPtr<FJsonObject>& JsonObject);
51 static void ParsePropOrFoliage(
const TSharedPtr<FJsonObject>& JsonObject,
const FString& ObjectType);
53 static void SpawnSensorToVehicle(
AVehicle*
Vehicle,
const TSharedPtr<FJsonObject>& SensorObject);
55 static void SpawnSensorWorld(
const TSharedPtr<FJsonObject>& SensorObject);
57 static void SpawnWalker(
const TSharedPtr<FJsonObject>& JsonObject);
59 static void ParseWalkerSpawnPoints(
const TSharedPtr<FJsonObject>& ParametersObject,
FWalkerParameters& WalkerParams);
61 static void ChangeWeather(
const TSharedPtr<FJsonObject>& JsonObject);
63 static void ParseAndSetDroneParameters(
APIDDrone* DronePtr,
const TSharedPtr<FJsonObject>& JsonObject);
65 static void TeleportSpectatorOrFollowActorIfField(
const TSharedPtr<FJsonObject>& JsonObject, AActor* Actor,
const FTransform&
Transform);
67 static void AttachActorToSpectatorCamera(AActor* ActorPtr);
69 static void ParseAndSetSemanticColors(
const TSharedPtr<FJsonObject>& JsonObject);
71 static void ParseCommands(
const TSharedPtr<FJsonObject>& JsonObject);
73 static void ParseVolumeDeletion(
const TSharedPtr<FJsonObject>& JsonObject);
75 static FTransform ParseTransform(
const FString& FieldName,
const TSharedPtr<FJsonObject>& Object);
77 static FVector4 ParseVector4(
const FString& FieldName,
const TSharedPtr<FJsonObject>& Object);
83 static FDVSCameraParameters ParseDVSCameraParameters(
const TSharedPtr<FJsonObject>& ParametersObject);
85 static int GetIntValueOrDefault(
const TSharedPtr<FJsonObject>& JsonObject,
const FString& FieldName,
int Default);
98 if (ParametersObject.IsValid())
100 FJsonObjectConverter::JsonObjectToUStruct(ParametersObject.ToSharedRef(), T::StaticStruct(), &Params);
static T ParseParameters(const TSharedPtr< FJsonObject > &ParametersObject)