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 void | ParseDataCapture (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) |
Static Private Attributes | |
static bool | IsDataCapture = false |
static TArray< ACamera * > | SpawnedCameras |
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 34 of file SimulatorJsonParser.h.
|
staticprivate |
Definition at line 730 of file SimulatorJsonParser.cpp.
References ASensor::GetSensorModel(), and UAgrarsenseStatics::GetSpectator().
Referenced by SpawnSensorWorld().
|
staticprivate |
Definition at line 588 of file SimulatorJsonParser.cpp.
References AWeather::GetCurrentWeather(), UAgrarsenseStatics::GetWeatherActor(), and AWeather::UpdateWeather().
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 1044 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 62 of file SimulatorJsonParser.cpp.
References ChangeWeather(), IsDataCapture, UAgrarsenseSettings::IsPlayingInMainMenu(), SimulatorLog::Log(), ParseAndSetSemanticColors(), ParseCommands(), ParseDataCapture(), ParsePropOrFoliage(), ParseVehicle(), ParseVolumeDeletion(), SpawnedCameras, SpawnSensorWorld(), and SpawnWalker().
Referenced by UROSCommands::HandleSpawnObjects(), and SDragAndDropWidget::OnDrop().
|
staticprivate |
Definition at line 628 of file SimulatorJsonParser.cpp.
References APIDDrone::ChangeDroneParameters(), FDroneParameters::DroneAction, FDroneParameters::DroneEndAction, GetDroneAction(), GetDroneEndAction(), ParseTransform(), and FDroneParameters::Points.
Referenced by ParseVehicle().
|
staticprivate |
Definition at line 775 of file SimulatorJsonParser.cpp.
References UMaterialParameterCollectionUtilities::LoadMaterialParameterCollectionInstance(), SimulatorLog::Log(), and UMaterialParameterCollectionUtilities::UpdateMaterialCollectionVectorValue().
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 823 of file SimulatorJsonParser.cpp.
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 883 of file SimulatorJsonParser.cpp.
References FCaptureData::Cameras, FCaptureData::CapturePositions, ParseTransform(), APhotoCapture::SetupPhotoCapture(), and SpawnedCameras.
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 996 of file SimulatorJsonParser.cpp.
Referenced by SpawnSensorToVehicle(), and SpawnSensorWorld().
|
staticprivate |
Definition at line 1032 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 97 of file SimulatorJsonParser.h.
|
staticprivate |
Definition at line 251 of file SimulatorJsonParser.cpp.
References UEnumUtilities::ConvertStringToFoliageType(), UEnumUtilities::ConvertStringToPropType(), ParseTransform(), UAssetLibrary::SpawnFoliage(), and UAssetLibrary::SpawnProp().
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 1008 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 927 of file SimulatorJsonParser.cpp.
Referenced by ParseAndSetDroneParameters(), ParseDataCapture(), ParsePropOrFoliage(), ParseVehicle(), ParseVolumeDeletion(), ParseWalkerSpawnPoints(), SpawnSensorToVehicle(), and SpawnSensorWorld().
|
staticprivate |
Definition at line 978 of file SimulatorJsonParser.cpp.
Referenced by ParseThermalCameraParameters().
|
staticprivate |
Definition at line 196 of file SimulatorJsonParser.cpp.
References UEnumUtilities::ConvertStringToVehicleType(), Drone, ParseAndSetDroneParameters(), ParseTransform(), SpawnSensorToVehicle(), UAssetLibrary::SpawnVehicle(), and TeleportSpectatorOrFollowActorIfField().
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 850 of file SimulatorJsonParser.cpp.
References ADeletionVolume::ChangeOverlapBounds(), ADeletionVolume::DestroyOverlappingActors(), and ParseTransform().
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 552 of file SimulatorJsonParser.cpp.
References ParseTransform(), and FWalkerParameters::Points.
Referenced by SpawnWalker().
|
staticprivate |
Definition at line 283 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 366 of file SimulatorJsonParser.cpp.
References AttachActorToSpectatorCamera(), UEnumUtilities::ConvertStringToSensorType(), DepthCamera, DVSCamera, ASimulationLevelManager::GetSensorsManager(), UAgrarsenseStatics::GetSimulationLevelManager(), IsDataCapture, Lidar, SimulatorLog::Log(), ParseDepthCameraParameters(), ParseDVSCameraParameters(), ParseThermalCameraParameters(), ParseTransform(), Radar, RGBCamera, SemanticSegmentationCamera, SpawnedCameras, TeleportSpectatorOrFollowActorIfField(), and ThermalCamera.
Referenced by ParseAndOperateJSONFile().
|
staticprivate |
Definition at line 474 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 682 of file SimulatorJsonParser.cpp.
References UAgrarsenseStatics::GetSimulationLevelManager(), UAgrarsenseStatics::GetSpectator(), ASimulationLevelManager::TakeManualControlOfVehicle(), ASpectator::TeleportSpectator(), and Transform.
Referenced by ParseVehicle(), SpawnSensorWorld(), and SpawnWalker().
|
staticprivate |
Definition at line 109 of file SimulatorJsonParser.h.
Referenced by ParseAndOperateJSONFile(), and SpawnSensorWorld().
|
staticprivate |
Definition at line 110 of file SimulatorJsonParser.h.
Referenced by ParseAndOperateJSONFile(), ParseDataCapture(), and SpawnSensorWorld().