Agrarsense
|
#include <SimulatorJsonExporter.h>
Static Public Member Functions | |
static FString | ExportInstancedActorsToJSON (FString FileName, const TArray< AInstancedActor * > &Actors) |
static FString | ExportVehicleAndSensorsToJSON (FString FileName, AVehicle *Vehicle, bool OverrideTransform=false, const FTransform &Transform=FTransform()) |
static FString | ExportWeatherToJSON (const FString &FileName, const FWeatherParameters &WeatherParameters) |
static FString | ExportWalkerToJSON (const FString &FileName, AWalker *Walker) |
static FString | ExportSensorToJSON (const FString &FileName, ASensor *Sensor) |
Static Private Member Functions | |
static TArray< TSharedPtr< FJsonValue > > | ParseLidars (const TArray< ALidar * > &Lidars) |
static TArray< TSharedPtr< FJsonValue > > | ParseCameras (const TArray< ACamera * > &Cameras) |
static TArray< TSharedPtr< FJsonValue > > | ParseDepthCameras (const TArray< ADepthCamera * > &DepthCameras) |
static TArray< TSharedPtr< FJsonValue > > | ParseThermalCameras (const TArray< AThermalCamera * > &ThermalCameras) |
static TArray< TSharedPtr< FJsonValue > > | ParseDVSCameras (const TArray< ADVSCamera * > &DVSCameras) |
static TArray< TSharedPtr< FJsonValue > > | ParseRadars (const TArray< ARadar * > &Radars) |
static TSharedPtr< FJsonObject > | CreateSensorJSONObject (const ASensor *SensorPtr, FString SensorName) |
static TSharedPtr< FJsonObject > | CameraParametersToJSONObject (const FCameraBaseParameters &Parameters) |
static void | SetSpawnPoint (TSharedPtr< FJsonObject > &ObjectEntry, const FVector &Location, const FRotator &Rotation, const FVector &Scale) |
static void | SetDroneParameters (TSharedPtr< FJsonObject > &ObjectEntry, AVehicle *VehiclePtr) |
static FString | CreateUniqueFilePath (FString FileName) |
USimulatorJsonExporter is a static UBlueprintFunctionLibrary that allows exporting some Simulator things such as sensors into JSON files that can be spawned back with USimulatorJsonParser.
Definition at line 38 of file SimulatorJsonExporter.h.
|
staticprivate |
Definition at line 739 of file SimulatorJsonExporter.cpp.
Referenced by ExportSensorToJSON(), and ParseCameras().
|
staticprivate |
Definition at line 711 of file SimulatorJsonExporter.cpp.
References ASensor::AttachedToBone, ASensor::AttachedToComponent, ASensor::GetActorID_Implementation(), ASensor::GetSensorName(), SetSpawnPoint(), and Transform.
Referenced by ParseCameras(), ParseDepthCameras(), ParseDVSCameras(), ParseLidars(), ParseRadars(), and ParseThermalCameras().
|
staticprivate |
This function generates unique file name within the specified directory. If the provided FileName is empty, a default name "ROSJsonFile" is used.
FileName | The desired base file name. |
Definition at line 821 of file SimulatorJsonExporter.cpp.
References UAgrarsensePaths::GetDataFolder().
Referenced by ExportInstancedActorsToJSON(), ExportSensorToJSON(), ExportVehicleAndSensorsToJSON(), ExportWalkerToJSON(), and ExportWeatherToJSON().
|
static |
Export a list of instanced actors to a JSON file. Actors with null references or with "none" type or model identifiers are excluded from the export.
FileName | The name of the JSON file to be saved. |
Actors | An array of AInstancedActor pointers representing the actors to export. |
Definition at line 200 of file SimulatorJsonExporter.cpp.
References CreateUniqueFilePath(), SimulatorLog::Log(), and SetSpawnPoint().
Referenced by UROSCommands::HandleExportFoliage(), and UROSCommands::HandleExportProps().
|
static |
Export Sensor and its parameters to a JSON file.
FileName | The name of the file without extension. |
Sensor | pointer to the Sensor object to be exported to JSON. |
Definition at line 388 of file SimulatorJsonExporter.cpp.
References CameraParametersToJSONObject(), Collision, UEnumUtilities::ConvertSensorTypeToString(), CreateUniqueFilePath(), DepthCamera, DVSCamera, ASensor::GetActorID_Implementation(), ACamera::GetCameraParameters(), ADepthCamera::GetDepthCameraParameters(), ADVSCamera::GetDVSCameraParameters(), ALidar::GetLidarParameters(), ARadar::GetRadarParameters(), ASensor::GetSensorType(), AThermalCamera::GetThermalCameraParameters(), Lidar, SimulatorLog::Log(), Overlap, Radar, RGBCamera, SemanticSegmentationCamera, SetSpawnPoint(), ThermalCamera, and Transform.
Referenced by ASensor::ExportToJsonFile().
|
static |
Export a vehicle and its associated sensors to a JSON file.
FileName | The name of the JSON file to be saved. |
Vehicle | A pointer to the vehicle to export. |
OverrideTransform | (Optional) Indicates whether to override the transform |
Transform | (Optional) The transformation information to use when exporting the vehicle if OverrideTransform is true |
Definition at line 40 of file SimulatorJsonExporter.cpp.
References CreateUniqueFilePath(), Drone, Forwarder, Harvester, SimulatorLog::Log(), NONE, ParseCameras(), ParseDepthCameras(), ParseDVSCameras(), ParseLidars(), ParseRadars(), ParseThermalCameras(), SetDroneParameters(), SetSpawnPoint(), Transform, and Vehicle.
Referenced by AVehicle::ExportToJsonFile().
|
static |
Export a Walker and its parameters to a JSON file.
FileName | The name of the file without extension. |
Walker | Pointer to the Walker object to be exported to JSON. |
Definition at line 269 of file SimulatorJsonExporter.cpp.
References UEnumUtilities::ConvertWalkerTypeToString(), CreateUniqueFilePath(), SimulatorLog::Log(), FWalkerParameters::Points, SetSpawnPoint(), Transform, Walker, and FWalkerParameters::WalkerType.
Referenced by AWalker::ExportToJsonFile().
|
static |
Export a FWeatherParameters to a JSON file.
FileName | The name of the JSON file to be saved. |
WeatherParameters | - The weather parameters to be exported to the JSON file. |
Definition at line 160 of file SimulatorJsonExporter.cpp.
References CreateUniqueFilePath(), and SimulatorLog::Log().
Referenced by AWeather::ExportToJSON().
|
staticprivate |
Definition at line 577 of file SimulatorJsonExporter.cpp.
References CameraParametersToJSONObject(), CreateSensorJSONObject(), and Transform.
Referenced by ExportVehicleAndSensorsToJSON().
|
staticprivate |
Definition at line 603 of file SimulatorJsonExporter.cpp.
References CreateSensorJSONObject(), and Transform.
Referenced by ExportVehicleAndSensorsToJSON().
|
staticprivate |
Definition at line 657 of file SimulatorJsonExporter.cpp.
References CreateSensorJSONObject(), and Transform.
Referenced by ExportVehicleAndSensorsToJSON().
|
staticprivate |
Definition at line 550 of file SimulatorJsonExporter.cpp.
References CreateSensorJSONObject(), Lidar, and Transform.
Referenced by ExportVehicleAndSensorsToJSON().
|
staticprivate |
Definition at line 684 of file SimulatorJsonExporter.cpp.
References CreateSensorJSONObject(), Radar, and Transform.
Referenced by ExportVehicleAndSensorsToJSON().
|
staticprivate |
Definition at line 630 of file SimulatorJsonExporter.cpp.
References CreateSensorJSONObject(), and Transform.
Referenced by ExportVehicleAndSensorsToJSON().
|
staticprivate |
Definition at line 769 of file SimulatorJsonExporter.cpp.
References FDroneParameters::DroneAction, FDroneParameters::DroneEndAction, APIDDrone::GetDroneParameters(), FDroneParameters::Points, and Transform.
Referenced by ExportVehicleAndSensorsToJSON().
|
staticprivate |
Definition at line 747 of file SimulatorJsonExporter.cpp.
Referenced by CreateSensorJSONObject(), ExportInstancedActorsToJSON(), ExportSensorToJSON(), ExportVehicleAndSensorsToJSON(), and ExportWalkerToJSON().