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 1016 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), and AOverlapSensor::SetOverlapBounds().
Referenced by AddCommands().
|
private |
Definition at line 1046 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), and AOverlapSensor::SetOverlapRelativePosition().
Referenced by AddCommands().
|
private |
Definition at line 1396 of file ROSCommands.cpp.
References ADeletionVolume::ChangeOverlapBounds(), ADeletionVolume::DestroyOverlappingActors(), and GetGameWorld().
Referenced by HandleDestroyActorsArea(), and HandleDestroyTreesArea().
|
private |
Definition at line 1391 of file ROSCommands.cpp.
References HandleDestroyActors().
Referenced by AddCommands().
|
private |
Definition at line 662 of file ROSCommands.cpp.
References USensorUtilities::DestroyAllSensors(), and GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 672 of file ROSCommands.cpp.
References GetGameWorld(), and Vehicle.
Referenced by AddCommands().
|
private |
Definition at line 667 of file ROSCommands.cpp.
References UAssetLibrary::DestroyAllWalkers().
Referenced by AddCommands().
|
private |
Definition at line 692 of file ROSCommands.cpp.
References ATagger::GetActorByInstanceID(), and GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 1386 of file ROSCommands.cpp.
References HandleDestroyActors().
Referenced by AddCommands().
|
private |
Definition at line 1319 of file ROSCommands.cpp.
References USensorUtilities::DisableAllSensors(), and GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 1314 of file ROSCommands.cpp.
References USensorUtilities::EnableAllSensors(), and GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 878 of file ROSCommands.cpp.
References HandleExportFoliage(), HandleExportProps(), HandleExportSensors(), HandleExportWalkers(), and HandleExportWeather().
Referenced by AddCommands().
|
private |
Definition at line 961 of file ROSCommands.cpp.
References USimulatorJsonExporter::ExportInstancedActorsToJSON(), and UAssetLibrary::GetAllAddedFoliageActors().
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 967 of file ROSCommands.cpp.
References GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 984 of file ROSCommands.cpp.
References USimulatorJsonExporter::ExportInstancedActorsToJSON(), and UAssetLibrary::GetAllAddedPropActors().
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 928 of file ROSCommands.cpp.
References ASensor::ExportToJsonFile(), AVehicle::ExportToJsonFile(), GetGameWorld(), and Sensors.
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 915 of file ROSCommands.cpp.
References AVehicle::ExportToJsonFile(), and UAssetLibrary::GetSpawnedVehicles().
Referenced by AddCommands().
|
private |
Definition at line 903 of file ROSCommands.cpp.
References UAssetLibrary::GetAllWalkers(), and Walker.
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 894 of file ROSCommands.cpp.
References AWeather::ExportToJSON(), GetGameWorld(), and UAgrarsenseStatics::GetWeatherActor().
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 1216 of file ROSCommands.cpp.
References Drone, FDroneParameters::DroneAction, FDroneParameters::DroneEndAction, IActorInformation::GetActorByID(), Roaming, and Transform.
Referenced by HandleMoveDroneToAndStop().
|
private |
Definition at line 1092 of file ROSCommands.cpp.
References HandleMoveDroneTo(), and Stop.
Referenced by AddCommands().
|
private |
Definition at line 1097 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 1082 of file ROSCommands.cpp.
References Destroy, and HandleMoveWalkerTo().
Referenced by AddCommands().
|
private |
Definition at line 1087 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 731 of file ROSCommands.cpp.
References PrintActorInformation().
Referenced by AddCommands().
|
private |
Definition at line 736 of file ROSCommands.cpp.
References PrintActorInformation().
Referenced by AddCommands().
|
private |
Definition at line 741 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 785 of file ROSCommands.cpp.
References IActorInformation::PrintAllIds().
Referenced by AddCommands().
|
private |
Definition at line 713 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 1203 of file ROSCommands.cpp.
References Drone, and IActorInformation::GetActorByID().
Referenced by AddCommands().
|
private |
Definition at line 1179 of file ROSCommands.cpp.
References HandleSetWalkerMovement().
Referenced by AddCommands().
|
private |
Definition at line 1295 of file ROSCommands.cpp.
References USensorUtilities::DisableAllSensors(), USensorUtilities::EnableAllSensors(), GetGameWorld(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 790 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetGlobalTargetFrameRate().
Referenced by AddCommands().
|
private |
Definition at line 803 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetGlobalTimeDilation().
Referenced by AddCommands().
|
private |
Definition at line 841 of file ROSCommands.cpp.
References GetSettings(), UAgrarsenseSettings::SetGrassVisibility(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 1373 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetNaniteMaxPixelsPerEdge().
Referenced by AddCommands().
|
private |
Definition at line 816 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetQualityLevelFromString().
Referenced by AddCommands().
|
private |
Definition at line 857 of file ROSCommands.cpp.
References GetGameWorld(), UAgrarsenseStatics::GetLidarManager(), ALidarManager::SetSaveCombinedCloudToDisk(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 1324 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 1184 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), and Walker.
Referenced by HandleResumeWalker(), and HandleStopWalker().
|
private |
Definition at line 825 of file ROSCommands.cpp.
References GetSettings(), UAgrarsenseSettings::SetWorldRendering(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 1360 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetWorldPositionOffsetRenderDistance().
Referenced by AddCommands().
|
private |
Definition at line 873 of file ROSCommands.cpp.
References USimulatorJsonParser::ParseAndOperateJSONFile().
Referenced by AddCommands().
|
private |
Definition at line 1174 of file ROSCommands.cpp.
References HandleSetWalkerMovement().
Referenced by AddCommands().
|
private |
Definition at line 557 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 ATagger::GetActorByInstanceID(), GetGameWorld(), and UAgrarsenseStatics::GetSpectator().
Referenced by AddCommands().
|
private |
Definition at line 468 of file ROSCommands.cpp.
References HandleTeleportSpectator(), and TeleportSpectatorHeight.
Referenced by AddCommands().
|
private |
Definition at line 645 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 1447 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), TryParseBoolean(), and Vehicle.
Referenced by AddCommands().
|
private |
Definition at line 990 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 746 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().