Agrarsense
|
#include <ROSCommands.h>
Public Member Functions | |
void | TryExecuteCommand (const FString &Command) |
Private Member Functions | |
void | Init () |
void | Destroy () |
UWorld * | GetGameWorld () |
UAgrarsenseSettings * | GetSettings () |
void | AddCommands () |
void | SetupROSCommandTopic () |
void | DestroyROSTopic () |
void | ParseIncomingMessage (const FString Message) |
void | ROSBridgeStateChanged (EROSState state) |
bool | TryParseBoolean (const FString &String, bool &OutBool) const |
void | HandlePrintAvailableCommands (const FString &Variable) |
void | HandleQuit (const FString &Variable) |
void | HandlePauseSimulator (const FString &Variable) |
void | HandleUnPauseSimulator (const FString &Variable) |
void | HandleAdvanceOneFrame (const FString &Variable) |
void | HandleAdvanceFrames (const FString &Variable) |
void | HandleAdvanceTime (const FString &Variable) |
void | HandleChangeMap (const FString &Variable) |
void | HandleUnrealCommand (const FString &Variable) |
void | HandleSetSpectatorOverlapRadius (const FString &Variable) |
void | HandleTeleportSpectatorHeight (const FString &Variable) |
void | HandleTeleportSpectator (const FString &Variable) |
void | HandleTeleportActorByID (const FString &Variable) |
void | HandleTeleportActorByIDHeight (const FString &Variable) |
void | HandleTeleportSpectatorByInstanceID (const FString &Variable) |
void | HandleTryDestroyObjectByID (const FString &Variable) |
void | HandleDestroyAllSensors (const FString &Variable) |
void | HandleDestroyAllWalkers (const FString &Variable) |
void | HandleDestroyAllVehicles (const FString &Variable) |
void | HandleDestroyObjectByInstanceID (const FString &Variable) |
void | HandlePrintMaps (const FString &Variable) |
void | HandlePrintAllSensors (const FString &Variable) |
void | HandlePrintAllVehicles (const FString &Variable) |
void | HandlePrintAllWalkers (const FString &Variable) |
void | PrintActorInformation (const FString &Variable, UClass *ActorClass, const FString &ActorTypeName) |
void | HandlePrintIds (const FString &Variable) |
void | HandleSetGlobalTargetFrameRate (const FString &Variable) |
void | HandleSetGlobalTimeDilation (const FString &Variable) |
void | HandleSetQualityLevel (const FString &Variable) |
void | HandleSetWorldRendering (const FString &Variable) |
void | HandleSetGrassVisibility (const FString &Variable) |
void | HandleSetSaveCombinedPointcloudToDisk (const FString &Variable) |
void | HandleSpawnObjects (const FString &Variable) |
void | HandleExportAll (const FString &Variable) |
void | HandleExportWeather (const FString &Variable) |
void | HandleExportWalkers (const FString &Variable) |
void | HandleExportVehicles (const FString &Variable) |
void | HandleExportSensors (const FString &Variable) |
void | HandleExportFoliage (const FString &Variable) |
void | HandleExportObjects (const FString &Variable) |
void | HandleExportProps (const FString &Variable) |
void | HandleVisualizeOverlapSensorsBounds (const FString &Variable) |
void | HandleChangeOverlapSensorBounds (const FString &Variable) |
void | HandleChangeOverlapSensorPosition (const FString &Variable) |
void | HandleMoveWalkerToAndDestroy (const FString &Variable) |
void | HandleMoveWalkerToAndStop (const FString &Variable) |
void | HandleMoveWalkerTo (const FString &Variable, EWalkerEndAction EndAction) |
void | HandleStopWalker (const FString &Variable) |
void | HandleResumeWalker (const FString &Variable) |
void | HandleSetWalkerMovement (const FString &Variable, bool IsPaused) |
void | HandleResetDrone (const FString &Variable) |
void | HandleMoveDroneTo (const FString &Variable, EDroneEndAction EndAction) |
void | HandleMoveDroneToAndStop (const FString &Variable) |
void | HandleSetAllSensorsEnabled (const FString &Variable) |
void | HandleEnableAllSensors (const FString &Variable) |
void | HandleDisableAllSensors (const FString &Variable) |
void | HandleSetSensorEnabled (const FString &Variable) |
void | HandleSetWPO (const FString &Variable) |
void | HandleSetNaniteMaxPixelsPerEdge (const FString &Variable) |
void | HandleDestroyTreesArea (const FString &Variable) |
void | HandleDestroyActorsArea (const FString &Variable) |
void | HandleDestroyActors (const FString &Variable, bool OnlyTrees) |
void | HandleVehicleMeshVisibility (const FString &Variable) |
Private Attributes | |
UTopic * | CommandTopic = nullptr |
UROSIntegrationGameInstance * | RosInstance = nullptr |
bool | InMeters = false |
bool | TeleportSpectatorHeight = false |
Static Private Attributes | |
static TMap< FString, FCommand > | CommandHandlers |
Friends | |
class | AAgrarsenseGameModeBase |
Definition at line 47 of file ROSCommands.h.
|
private |
Definition at line 84 of file ROSCommands.cpp.
References CommandHandlers, HandleAdvanceFrames(), HandleAdvanceOneFrame(), HandleAdvanceTime(), HandleChangeMap(), HandleChangeOverlapSensorBounds(), HandleChangeOverlapSensorPosition(), HandleDestroyActorsArea(), HandleDestroyAllSensors(), HandleDestroyAllVehicles(), HandleDestroyAllWalkers(), HandleDestroyObjectByInstanceID(), HandleDestroyTreesArea(), HandleDisableAllSensors(), HandleEnableAllSensors(), HandleExportAll(), HandleExportFoliage(), HandleExportObjects(), HandleExportProps(), HandleExportSensors(), HandleExportVehicles(), HandleExportWalkers(), HandleExportWeather(), HandleMoveDroneToAndStop(), HandleMoveWalkerToAndDestroy(), HandleMoveWalkerToAndStop(), HandlePauseSimulator(), HandlePrintAllSensors(), HandlePrintAllVehicles(), HandlePrintAvailableCommands(), HandlePrintIds(), HandlePrintMaps(), HandleQuit(), HandleResetDrone(), HandleResumeWalker(), HandleSetAllSensorsEnabled(), HandleSetGlobalTargetFrameRate(), HandleSetGlobalTimeDilation(), HandleSetGrassVisibility(), HandleSetNaniteMaxPixelsPerEdge(), HandleSetQualityLevel(), HandleSetSaveCombinedPointcloudToDisk(), HandleSetSensorEnabled(), HandleSetSpectatorOverlapRadius(), HandleSetWorldRendering(), HandleSetWPO(), HandleSpawnObjects(), HandleStopWalker(), HandleTeleportActorByID(), HandleTeleportActorByIDHeight(), HandleTeleportSpectator(), HandleTeleportSpectatorByInstanceID(), HandleTeleportSpectatorHeight(), HandleTryDestroyObjectByID(), HandleUnPauseSimulator(), HandleUnrealCommand(), HandleVehicleMeshVisibility(), and HandleVisualizeOverlapSensorsBounds().
Referenced by Init().
|
private |
Definition at line 59 of file ROSCommands.cpp.
References DestroyROSTopic().
Referenced by AAgrarsenseGameModeBase::EndPlay().
|
private |
Definition at line 208 of file ROSCommands.cpp.
References CommandTopic.
Referenced by Destroy(), and ROSBridgeStateChanged().
|
private |
Definition at line 69 of file ROSCommands.cpp.
Referenced by HandleDestroyActors(), HandleDestroyAllSensors(), HandleDestroyAllVehicles(), HandleDestroyObjectByInstanceID(), HandleDisableAllSensors(), HandleEnableAllSensors(), HandleExportObjects(), HandleExportSensors(), HandleExportWeather(), HandleQuit(), HandleSetAllSensorsEnabled(), HandleSetSaveCombinedPointcloudToDisk(), HandleSetSpectatorOverlapRadius(), HandleTeleportSpectator(), HandleTeleportSpectatorByInstanceID(), HandleUnrealCommand(), HandleVisualizeOverlapSensorsBounds(), Init(), PrintActorInformation(), and SetupROSCommandTopic().
|
private |
Definition at line 79 of file ROSCommands.cpp.
References UAgrarsenseStatics::GetAgrarsenseSettings().
Referenced by HandleAdvanceFrames(), HandleAdvanceOneFrame(), HandleAdvanceTime(), HandleChangeMap(), HandlePauseSimulator(), HandlePrintMaps(), HandleSetGlobalTargetFrameRate(), HandleSetGlobalTimeDilation(), HandleSetGrassVisibility(), HandleSetNaniteMaxPixelsPerEdge(), HandleSetQualityLevel(), HandleSetWorldRendering(), HandleSetWPO(), and HandleUnPauseSimulator().
|
private |
Definition at line 391 of file ROSCommands.cpp.
References UAgrarsenseSettings::AdvanceFrameCount(), and GetSettings().
Referenced by AddCommands().
|
private |
Definition at line 382 of file ROSCommands.cpp.
References UAgrarsenseSettings::AdvanceFrameCount(), and GetSettings().
Referenced by AddCommands().
|
private |
Definition at line 410 of file ROSCommands.cpp.
References UAgrarsenseSettings::AdvanceTime(), and GetSettings().
Referenced by AddCommands().
|
private |
Definition at line 429 of file ROSCommands.cpp.
References UAgrarsenseSettings::ChangeMapByName(), and GetSettings().
Referenced by AddCommands().
|
private |
Definition at line 1038 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), and AOverlapSensor::SetOverlapBounds().
Referenced by AddCommands().
|
private |
Definition at line 1068 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), and AOverlapSensor::SetOverlapRelativePosition().
Referenced by AddCommands().
|
private |
Definition at line 1418 of file ROSCommands.cpp.
References ADeletionVolume::ChangeOverlapBounds(), ADeletionVolume::DestroyOverlappingActors(), and GetGameWorld().
Referenced by HandleDestroyActorsArea(), and HandleDestroyTreesArea().
|
private |
Definition at line 1413 of file ROSCommands.cpp.
References HandleDestroyActors().
Referenced by AddCommands().
|
private |
Definition at line 673 of file ROSCommands.cpp.
References USensorUtilities::DestroyAllSensors(), and GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 683 of file ROSCommands.cpp.
References GetGameWorld(), and Vehicle.
Referenced by AddCommands().
|
private |
Definition at line 678 of file ROSCommands.cpp.
References UAssetLibrary::DestroyAllWalkers().
Referenced by AddCommands().
|
private |
Definition at line 703 of file ROSCommands.cpp.
References GetGameWorld(), and ATagger::TryGetActorByInstanceID().
Referenced by AddCommands().
|
private |
Definition at line 1408 of file ROSCommands.cpp.
References HandleDestroyActors().
Referenced by AddCommands().
|
private |
Definition at line 1341 of file ROSCommands.cpp.
References USensorUtilities::DisableAllSensors(), and GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 1336 of file ROSCommands.cpp.
References USensorUtilities::EnableAllSensors(), and GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 900 of file ROSCommands.cpp.
References HandleExportFoliage(), HandleExportProps(), HandleExportSensors(), HandleExportWalkers(), and HandleExportWeather().
Referenced by AddCommands().
|
private |
Definition at line 983 of file ROSCommands.cpp.
References USimulatorJsonExporter::ExportInstancedActorsToJSON(), and UAssetLibrary::GetAllAddedFoliageActors().
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 989 of file ROSCommands.cpp.
References GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 1006 of file ROSCommands.cpp.
References USimulatorJsonExporter::ExportInstancedActorsToJSON(), and UAssetLibrary::GetAllAddedPropActors().
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 950 of file ROSCommands.cpp.
References ASensor::ExportToJsonFile(), AVehicle::ExportToJsonFile(), GetGameWorld(), and Sensors.
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 937 of file ROSCommands.cpp.
References AVehicle::ExportToJsonFile(), and UAssetLibrary::GetSpawnedVehicles().
Referenced by AddCommands().
|
private |
Definition at line 925 of file ROSCommands.cpp.
References UAssetLibrary::GetAllWalkers(), and Walker.
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 916 of file ROSCommands.cpp.
References AWeather::ExportToJSON(), GetGameWorld(), and UAgrarsenseStatics::GetWeatherActor().
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 1238 of file ROSCommands.cpp.
References Drone, FDroneParameters::DroneAction, FDroneParameters::DroneEndAction, IActorInformation::GetActorByID(), Roaming, and Transform.
Referenced by HandleMoveDroneToAndStop().
|
private |
Definition at line 1114 of file ROSCommands.cpp.
References HandleMoveDroneTo(), and Stop.
Referenced by AddCommands().
|
private |
Definition at line 1119 of file ROSCommands.cpp.
References FollowPath, IActorInformation::GetActorByID(), FWalkerParameters::Points, Transform, Walker, FWalkerParameters::WalkerAction, and FWalkerParameters::WalkerEndAction.
Referenced by HandleMoveWalkerToAndDestroy(), and HandleMoveWalkerToAndStop().
|
private |
Definition at line 1104 of file ROSCommands.cpp.
References Destroy, and HandleMoveWalkerTo().
Referenced by AddCommands().
|
private |
Definition at line 1109 of file ROSCommands.cpp.
References HandleMoveWalkerTo(), and Stop.
Referenced by AddCommands().
|
private |
Definition at line 364 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::PauseSimulationEndOfThisFrame().
Referenced by AddCommands().
|
private |
Definition at line 753 of file ROSCommands.cpp.
References PrintActorInformation().
Referenced by AddCommands().
|
private |
Definition at line 758 of file ROSCommands.cpp.
References PrintActorInformation().
Referenced by AddCommands().
|
private |
Definition at line 763 of file ROSCommands.cpp.
References PrintActorInformation().
|
private |
Definition at line 329 of file ROSCommands.cpp.
References CommandHandlers, CommandTopic, FCommand::DefaultValue, and SimulatorLog::Log().
Referenced by AddCommands().
|
private |
Definition at line 807 of file ROSCommands.cpp.
References IActorInformation::PrintAllIds().
Referenced by AddCommands().
|
private |
Definition at line 735 of file ROSCommands.cpp.
References UAgrarsenseSettings::GetMapNames(), GetSettings(), and SimulatorLog::Log().
Referenced by AddCommands().
|
private |
Definition at line 355 of file ROSCommands.cpp.
References GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 1225 of file ROSCommands.cpp.
References Drone, and IActorInformation::GetActorByID().
Referenced by AddCommands().
|
private |
Definition at line 1201 of file ROSCommands.cpp.
References HandleSetWalkerMovement().
Referenced by AddCommands().
|
private |
Definition at line 1317 of file ROSCommands.cpp.
References USensorUtilities::DisableAllSensors(), USensorUtilities::EnableAllSensors(), GetGameWorld(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 812 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetGlobalTargetFrameRate().
Referenced by AddCommands().
|
private |
Definition at line 825 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetGlobalTimeDilation().
Referenced by AddCommands().
|
private |
Definition at line 863 of file ROSCommands.cpp.
References GetSettings(), UAgrarsenseSettings::SetGrassVisibility(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 1395 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetNaniteMaxPixelsPerEdge().
Referenced by AddCommands().
|
private |
Definition at line 838 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetQualityLevelFromString().
Referenced by AddCommands().
|
private |
Definition at line 879 of file ROSCommands.cpp.
References GetGameWorld(), UAgrarsenseStatics::GetLidarManager(), ALidarManager::SetSaveCombinedCloudToDisk(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 1346 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), ASensor::SetSimulateSensor(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 447 of file ROSCommands.cpp.
References GetGameWorld(), and UAgrarsenseStatics::GetSpectator().
Referenced by AddCommands().
|
private |
Definition at line 1206 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), and Walker.
Referenced by HandleResumeWalker(), and HandleStopWalker().
|
private |
Definition at line 847 of file ROSCommands.cpp.
References GetSettings(), UAgrarsenseSettings::SetWorldRendering(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 1382 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetWorldPositionOffsetRenderDistance().
Referenced by AddCommands().
|
private |
Definition at line 895 of file ROSCommands.cpp.
References USimulatorJsonParser::ParseAndOperateJSONFile().
Referenced by AddCommands().
|
private |
Definition at line 1196 of file ROSCommands.cpp.
References HandleSetWalkerMovement().
Referenced by AddCommands().
|
private |
Definition at line 568 of file ROSCommands.cpp.
References UPhysicsUtilities::AlignTransformFromGroundInMeters(), IActorInformation::GetActorByID(), InMeters, SimulatorLog::Log(), AVehicle::TogglePhysics(), and Transform.
Referenced by AddCommands(), and HandleTeleportActorByIDHeight().
|
private |
Definition at line 526 of file ROSCommands.cpp.
References HandleTeleportActorByID(), and InMeters.
Referenced by AddCommands().
|
private |
Definition at line 475 of file ROSCommands.cpp.
References UPhysicsUtilities::AlignTransformFromGroundInMeters(), GetGameWorld(), UAgrarsenseStatics::GetSpectator(), ASpectator::TeleportSpectator(), TeleportSpectatorHeight, and Transform.
Referenced by AddCommands(), and HandleTeleportSpectatorHeight().
|
private |
Definition at line 533 of file ROSCommands.cpp.
References GetGameWorld(), UAgrarsenseStatics::GetSpectator(), and ATagger::TryGetActorByInstanceID().
Referenced by AddCommands().
|
private |
Definition at line 468 of file ROSCommands.cpp.
References HandleTeleportSpectator(), and TeleportSpectatorHeight.
Referenced by AddCommands().
|
private |
Definition at line 656 of file ROSCommands.cpp.
References IActorInformation::DestroyActorByID(), and SimulatorLog::Log().
Referenced by AddCommands().
|
private |
Definition at line 373 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::UnPauseSimulation().
Referenced by AddCommands().
|
private |
Definition at line 438 of file ROSCommands.cpp.
References GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 1469 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), TryParseBoolean(), and Vehicle.
Referenced by AddCommands().
|
private |
Definition at line 1012 of file ROSCommands.cpp.
References GetGameWorld(), AOverlapSensor::SetVisualizeOverlapArea(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 46 of file ROSCommands.cpp.
References AddCommands(), GetGameWorld(), UAgrarsenseStatics::GetROSHandle(), UROSHandler::OnROSStateChanged, ROSBridgeStateChanged(), and SetupROSCommandTopic().
Referenced by AAgrarsenseGameModeBase::SpawnNeededActorsBeginPlay().
|
private |
Definition at line 256 of file ROSCommands.cpp.
References CommandHandlers, FCommand::CooldownTime, FCommand::Handler, FCommand::LastExecutionTime, and SimulatorLog::Log().
Referenced by SetupROSCommandTopic(), and TryExecuteCommand().
|
private |
Definition at line 768 of file ROSCommands.cpp.
References GetGameWorld(), and SimulatorLog::Log().
Referenced by HandlePrintAllSensors(), HandlePrintAllVehicles(), and HandlePrintAllWalkers().
|
private |
Definition at line 194 of file ROSCommands.cpp.
References Connected, DestroyROSTopic(), Disconnected, and SetupROSCommandTopic().
Referenced by Init().
|
private |
Definition at line 220 of file ROSCommands.cpp.
References CommandTopic, GetGameWorld(), UAgrarsenseStatics::GetROSGameInstance(), ParseIncomingMessage(), and RosInstance.
Referenced by Init(), and ROSBridgeStateChanged().
void UROSCommands::TryExecuteCommand | ( | const FString & | Command | ) |
Definition at line 64 of file ROSCommands.cpp.
References ParseIncomingMessage().
|
private |
Attempts to parse a string into a boolean value.
String | The string to parse into a boolean value. |
OutBool | A reference to a boolean where the result will be stored if the parsing is successful. |
Definition at line 310 of file ROSCommands.cpp.
Referenced by HandleSetAllSensorsEnabled(), HandleSetGrassVisibility(), HandleSetSaveCombinedPointcloudToDisk(), HandleSetSensorEnabled(), HandleSetWorldRendering(), HandleVehicleMeshVisibility(), and HandleVisualizeOverlapSensorsBounds().
|
friend |
Definition at line 63 of file ROSCommands.h.
|
staticprivate |
Definition at line 74 of file ROSCommands.h.
Referenced by AddCommands(), HandlePrintAvailableCommands(), and ParseIncomingMessage().
|
private |
Definition at line 103 of file ROSCommands.h.
Referenced by DestroyROSTopic(), HandlePrintAvailableCommands(), and SetupROSCommandTopic().
|
private |
Definition at line 108 of file ROSCommands.h.
Referenced by HandleTeleportActorByID(), and HandleTeleportActorByIDHeight().
|
private |
Definition at line 106 of file ROSCommands.h.
Referenced by SetupROSCommandTopic().
|
private |
Definition at line 110 of file ROSCommands.h.
Referenced by HandleTeleportSpectator(), and HandleTeleportSpectatorHeight().