Agrarsense
|
#include <SimulatorJsonParser.h>
Static Public Member Functions | |
static void | ParseAndOperateJSONFile (const FString &Path) |
Static Private Member Functions | |
static void | ParseVehicle (const TSharedPtr< FJsonObject > &JsonObject) |
static void | ParsePropOrFoliage (const TSharedPtr< FJsonObject > &JsonObject, const FString &ObjectType) |
static void | SpawnSensorToVehicle (AVehicle *Vehicle, const TSharedPtr< FJsonObject > &SensorObject) |
static void | SpawnSensorWorld (const TSharedPtr< FJsonObject > &SensorObject) |
static void | SpawnWalker (const TSharedPtr< FJsonObject > &JsonObject) |
static void | ParseWalkerSpawnPoints (const TSharedPtr< FJsonObject > &ParametersObject, FWalkerParameters &WalkerParams) |
static void | ChangeWeather (const TSharedPtr< FJsonObject > &JsonObject) |
static void | ParseAndSetDroneParameters (APIDDrone *DronePtr, const TSharedPtr< FJsonObject > &JsonObject) |
static void | TeleportSpectatorOrFollowActorIfField (const TSharedPtr< FJsonObject > &JsonObject, AActor *Actor, const FTransform &Transform) |
static void | AttachActorToSpectatorCamera (AActor *ActorPtr) |
static void | ParseAndSetSemanticColors (const TSharedPtr< FJsonObject > &JsonObject) |
static void | ParseCommands (const TSharedPtr< FJsonObject > &JsonObject) |
static void | ParseVolumeDeletion (const TSharedPtr< FJsonObject > &JsonObject) |
static FTransform | ParseTransform (const FString &FieldName, const TSharedPtr< FJsonObject > &Object) |
static FVector4 | ParseVector4 (const FString &FieldName, const TSharedPtr< FJsonObject > &Object) |
static FDepthCameraParameters | ParseDepthCameraParameters (const TSharedPtr< FJsonObject > &ParametersObject) |
static FThermalCameraParameters | ParseThermalCameraParameters (const TSharedPtr< FJsonObject > &ParametersObject) |
static FDVSCameraParameters | ParseDVSCameraParameters (const TSharedPtr< FJsonObject > &ParametersObject) |
static int | GetIntValueOrDefault (const TSharedPtr< FJsonObject > &JsonObject, const FString &FieldName, int Default) |
template<typename T > | |
static T | ParseParameters (const TSharedPtr< FJsonObject > &ParametersObject) |
USimulatorJsonParser is a static UBlueprintFunctionLibrary that can read and parse json file content and tries to spawn objects defined in the json file.
Definition at line 33 of file SimulatorJsonParser.h.
|
staticprivate |
Definition at line 648 of file SimulatorJsonParser.cpp.
References ASensor::GetSensorModel(), and UAgrarsenseStatics::GetSpectator().
Referenced by SpawnSensorWorld().
|
staticprivate |
Definition at line 538 of file SimulatorJsonParser.cpp.
References AWeather::GetCurrentWeather(), UAgrarsenseStatics::GetWeatherActor(), and AWeather::UpdateWeather().
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 916 of file SimulatorJsonParser.cpp.
Referenced by SpawnWalker().
|
static |
Try to load json file from Path and operate it based on the JSON content.
Path | full path to the JSON file, ex. C:\Agrarsense\Examples\ExampleJsonFiles\lidar.json |
Definition at line 58 of file SimulatorJsonParser.cpp.
References ChangeWeather(), UAgrarsenseSettings::IsPlayingInMainMenu(), SimulatorLog::Log(), ParseAndSetSemanticColors(), ParseCommands(), ParsePropOrFoliage(), ParseVehicle(), ParseVolumeDeletion(), SpawnSensorWorld(), and SpawnWalker().
Referenced by UROSCommands::HandleSpawnObjects(), and SDragAndDropWidget::OnDrop().
|
staticprivate |
Definition at line 559 of file SimulatorJsonParser.cpp.
References APIDDrone::ChangeDroneParameters(), ParseTransform(), and FDroneParameters::Points.
Referenced by ParseVehicle().
|
staticprivate |
Definition at line 693 of file SimulatorJsonParser.cpp.
References UMaterialParameterCollectionUtilities::LoadMaterialParameterCollectionInstance(), SimulatorLog::Log(), and UMaterialParameterCollectionUtilities::UpdateMaterialCollectionVectorValue().
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 741 of file SimulatorJsonParser.cpp.
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 868 of file SimulatorJsonParser.cpp.
Referenced by SpawnSensorToVehicle(), and SpawnSensorWorld().
|
staticprivate |
Definition at line 904 of file SimulatorJsonParser.cpp.
Referenced by SpawnSensorToVehicle(), and SpawnSensorWorld().
|
inlinestaticprivate |
Templated function to parse parameters from JSON object into specific struct. Requires the struct type T to have a StaticStruct method compatible with FJsonObjectConverter::JsonObjectToUStruct.
SensorObject | The JSON object from which to parse the parameters. |
Definition at line 94 of file SimulatorJsonParser.h.
|
staticprivate |
Definition at line 210 of file SimulatorJsonParser.cpp.
References UEnumUtilities::ConvertStringToFoliageType(), UEnumUtilities::ConvertStringToPropType(), ParseTransform(), UAssetLibrary::SpawnFoliage(), and UAssetLibrary::SpawnProp().
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 880 of file SimulatorJsonParser.cpp.
References FThermalCameraParameters::AllowCustomNoiseResolution, FThermalCameraParameters::CameraParameters, FThermalCameraParameters::ColdColor, FThermalCameraParameters::HeightResolutionNoise, ParseVector4(), FThermalCameraParameters::WarmColor, and FThermalCameraParameters::WidthResolutionNoise.
Referenced by SpawnSensorWorld().
|
staticprivate |
Definition at line 801 of file SimulatorJsonParser.cpp.
Referenced by ParseAndSetDroneParameters(), ParsePropOrFoliage(), ParseVehicle(), ParseVolumeDeletion(), ParseWalkerSpawnPoints(), SpawnSensorToVehicle(), and SpawnSensorWorld().
|
staticprivate |
Definition at line 850 of file SimulatorJsonParser.cpp.
Referenced by ParseThermalCameraParameters().
|
staticprivate |
Definition at line 155 of file SimulatorJsonParser.cpp.
References UEnumUtilities::ConvertStringToVehicleType(), Drone, ParseAndSetDroneParameters(), ParseTransform(), SpawnSensorToVehicle(), UAssetLibrary::SpawnVehicle(), and TeleportSpectatorOrFollowActorIfField().
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 768 of file SimulatorJsonParser.cpp.
References ADeletionVolume::ChangeOverlapBounds(), ADeletionVolume::DestroyOverlappingActors(), and ParseTransform().
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 502 of file SimulatorJsonParser.cpp.
References ParseTransform(), and FWalkerParameters::Points.
Referenced by SpawnWalker().
|
staticprivate |
Definition at line 242 of file SimulatorJsonParser.cpp.
References UEnumUtilities::ConvertStringToSensorType(), DepthCamera, DVSCamera, Lidar, ParseDepthCameraParameters(), ParseDVSCameraParameters(), ParseTransform(), Radar, RGBCamera, SemanticSegmentationCamera, ThermalCamera, and Vehicle.
Referenced by ParseVehicle().
|
staticprivate |
Definition at line 325 of file SimulatorJsonParser.cpp.
References AttachActorToSpectatorCamera(), UEnumUtilities::ConvertStringToSensorType(), DepthCamera, DVSCamera, ASimulationLevelManager::GetSensorsManager(), UAgrarsenseStatics::GetSimulationLevelManager(), Lidar, SimulatorLog::Log(), ParseDepthCameraParameters(), ParseDVSCameraParameters(), ParseThermalCameraParameters(), ParseTransform(), Radar, RGBCamera, SemanticSegmentationCamera, TeleportSpectatorOrFollowActorIfField(), and ThermalCamera.
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 424 of file SimulatorJsonParser.cpp.
References UEnumUtilities::ConvertStringToWalkerActionType(), UEnumUtilities::ConvertStringToWalkerEndActionType(), UEnumUtilities::ConvertStringToWalkerType(), GetIntValueOrDefault(), SimulatorLog::Log(), NONE, ParseWalkerSpawnPoints(), FWalkerParameters::Points, Roaming, UAssetLibrary::SpawnWalker(), TeleportSpectatorOrFollowActorIfField(), Walker, FWalkerParameters::WalkerAction, FWalkerParameters::WalkerEndAction, FWalkerParameters::WalkerSpeed, and FWalkerParameters::WalkerType.
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 600 of file SimulatorJsonParser.cpp.
References UAgrarsenseStatics::GetSimulationLevelManager(), UAgrarsenseStatics::GetSpectator(), ASimulationLevelManager::TakeManualControlOfVehicle(), ASpectator::TeleportSpectator(), and Transform.
Referenced by ParseVehicle(), SpawnSensorWorld(), and SpawnWalker().