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 | 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(), 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 205 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 388 of file ROSCommands.cpp.
References UAgrarsenseSettings::AdvanceFrameCount(), and GetSettings().
Referenced by AddCommands().
|
private |
Definition at line 379 of file ROSCommands.cpp.
References UAgrarsenseSettings::AdvanceFrameCount(), and GetSettings().
Referenced by AddCommands().
|
private |
Definition at line 407 of file ROSCommands.cpp.
References UAgrarsenseSettings::AdvanceTime(), and GetSettings().
Referenced by AddCommands().
|
private |
Definition at line 426 of file ROSCommands.cpp.
References UAgrarsenseSettings::ChangeMapByName(), and GetSettings().
Referenced by AddCommands().
|
private |
Definition at line 1013 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), and AOverlapSensor::SetOverlapBounds().
Referenced by AddCommands().
|
private |
Definition at line 1043 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), and AOverlapSensor::SetOverlapRelativePosition().
Referenced by AddCommands().
|
private |
Definition at line 1380 of file ROSCommands.cpp.
References ADeletionVolume::ChangeOverlapBounds(), ADeletionVolume::DestroyOverlappingActors(), and GetGameWorld().
Referenced by HandleDestroyActorsArea(), and HandleDestroyTreesArea().
|
private |
Definition at line 1375 of file ROSCommands.cpp.
References HandleDestroyActors().
Referenced by AddCommands().
|
private |
Definition at line 659 of file ROSCommands.cpp.
References USensorUtilities::DestroyAllSensors(), and GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 669 of file ROSCommands.cpp.
References GetGameWorld(), and Vehicle.
Referenced by AddCommands().
|
private |
Definition at line 664 of file ROSCommands.cpp.
References UAssetLibrary::DestroyAllWalkers().
Referenced by AddCommands().
|
private |
Definition at line 689 of file ROSCommands.cpp.
References ATagger::GetActorByInstanceID(), and GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 1370 of file ROSCommands.cpp.
References HandleDestroyActors().
Referenced by AddCommands().
|
private |
Definition at line 1303 of file ROSCommands.cpp.
References USensorUtilities::DisableAllSensors(), and GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 1298 of file ROSCommands.cpp.
References USensorUtilities::EnableAllSensors(), and GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 875 of file ROSCommands.cpp.
References HandleExportFoliage(), HandleExportProps(), HandleExportSensors(), HandleExportWalkers(), and HandleExportWeather().
Referenced by AddCommands().
|
private |
Definition at line 958 of file ROSCommands.cpp.
References USimulatorJsonExporter::ExportInstancedActorsToJSON(), and UAssetLibrary::GetAllAddedFoliageActors().
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 964 of file ROSCommands.cpp.
References GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 981 of file ROSCommands.cpp.
References USimulatorJsonExporter::ExportInstancedActorsToJSON(), and UAssetLibrary::GetAllAddedPropActors().
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 925 of file ROSCommands.cpp.
References ASensor::ExportToJsonFile(), AVehicle::ExportToJsonFile(), GetGameWorld(), and Sensors.
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 912 of file ROSCommands.cpp.
References AVehicle::ExportToJsonFile(), and UAssetLibrary::GetSpawnedVehicles().
Referenced by AddCommands().
|
private |
Definition at line 900 of file ROSCommands.cpp.
References UAssetLibrary::GetAllWalkers(), and Walker.
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 891 of file ROSCommands.cpp.
References AWeather::ExportToJSON(), GetGameWorld(), and UAgrarsenseStatics::GetWeatherActor().
Referenced by AddCommands(), and HandleExportAll().
|
private |
Definition at line 1200 of file ROSCommands.cpp.
References Drone, FDroneParameters::DroneAction, FDroneParameters::DroneEndAction, IActorInformation::GetActorByID(), Roaming, and Transform.
Referenced by HandleMoveDroneToAndStop().
|
private |
Definition at line 1089 of file ROSCommands.cpp.
References HandleMoveDroneTo(), and Stop.
Referenced by AddCommands().
|
private |
Definition at line 1094 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 1079 of file ROSCommands.cpp.
References Destroy, and HandleMoveWalkerTo().
Referenced by AddCommands().
|
private |
Definition at line 1084 of file ROSCommands.cpp.
References HandleMoveWalkerTo(), and Stop.
Referenced by AddCommands().
|
private |
Definition at line 361 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::PauseSimulationEndOfThisFrame().
Referenced by AddCommands().
|
private |
Definition at line 728 of file ROSCommands.cpp.
References PrintActorInformation().
Referenced by AddCommands().
|
private |
Definition at line 733 of file ROSCommands.cpp.
References PrintActorInformation().
Referenced by AddCommands().
|
private |
Definition at line 738 of file ROSCommands.cpp.
References PrintActorInformation().
|
private |
Definition at line 326 of file ROSCommands.cpp.
References CommandHandlers, CommandTopic, FCommand::DefaultValue, and SimulatorLog::Log().
Referenced by AddCommands().
|
private |
Definition at line 782 of file ROSCommands.cpp.
References IActorInformation::PrintAllIds().
Referenced by AddCommands().
|
private |
Definition at line 710 of file ROSCommands.cpp.
References UAgrarsenseSettings::GetMapNames(), GetSettings(), and SimulatorLog::Log().
Referenced by AddCommands().
|
private |
Definition at line 352 of file ROSCommands.cpp.
References GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 1176 of file ROSCommands.cpp.
References HandleSetWalkerMovement().
Referenced by AddCommands().
|
private |
Definition at line 1279 of file ROSCommands.cpp.
References USensorUtilities::DisableAllSensors(), USensorUtilities::EnableAllSensors(), GetGameWorld(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 787 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetGlobalTargetFrameRate().
Referenced by AddCommands().
|
private |
Definition at line 800 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetGlobalTimeDilation().
Referenced by AddCommands().
|
private |
Definition at line 838 of file ROSCommands.cpp.
References GetSettings(), UAgrarsenseSettings::SetGrassVisibility(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 1357 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetNaniteMaxPixelsPerEdge().
Referenced by AddCommands().
|
private |
Definition at line 813 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetQualityLevelFromString().
Referenced by AddCommands().
|
private |
Definition at line 854 of file ROSCommands.cpp.
References GetGameWorld(), UAgrarsenseStatics::GetLidarManager(), ALidarManager::SetSaveCombinedCloudToDisk(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 1308 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), ASensor::SetSimulateSensor(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 444 of file ROSCommands.cpp.
References GetGameWorld(), and UAgrarsenseStatics::GetSpectator().
Referenced by AddCommands().
|
private |
Definition at line 1181 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), and Walker.
Referenced by HandleResumeWalker(), and HandleStopWalker().
|
private |
Definition at line 822 of file ROSCommands.cpp.
References GetSettings(), UAgrarsenseSettings::SetWorldRendering(), and TryParseBoolean().
Referenced by AddCommands().
|
private |
Definition at line 1344 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::SetWorldPositionOffsetRenderDistance().
Referenced by AddCommands().
|
private |
Definition at line 870 of file ROSCommands.cpp.
References USimulatorJsonParser::ParseAndOperateJSONFile().
Referenced by AddCommands().
|
private |
Definition at line 1171 of file ROSCommands.cpp.
References HandleSetWalkerMovement().
Referenced by AddCommands().
|
private |
Definition at line 554 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 523 of file ROSCommands.cpp.
References HandleTeleportActorByID(), and InMeters.
Referenced by AddCommands().
|
private |
Definition at line 472 of file ROSCommands.cpp.
References UPhysicsUtilities::AlignTransformFromGroundInMeters(), GetGameWorld(), UAgrarsenseStatics::GetSpectator(), ASpectator::TeleportSpectator(), TeleportSpectatorHeight, and Transform.
Referenced by AddCommands(), and HandleTeleportSpectatorHeight().
|
private |
Definition at line 530 of file ROSCommands.cpp.
References ATagger::GetActorByInstanceID(), GetGameWorld(), and UAgrarsenseStatics::GetSpectator().
Referenced by AddCommands().
|
private |
Definition at line 465 of file ROSCommands.cpp.
References HandleTeleportSpectator(), and TeleportSpectatorHeight.
Referenced by AddCommands().
|
private |
Definition at line 642 of file ROSCommands.cpp.
References IActorInformation::DestroyActorByID(), and SimulatorLog::Log().
Referenced by AddCommands().
|
private |
Definition at line 370 of file ROSCommands.cpp.
References GetSettings(), and UAgrarsenseSettings::UnPauseSimulation().
Referenced by AddCommands().
|
private |
Definition at line 435 of file ROSCommands.cpp.
References GetGameWorld().
Referenced by AddCommands().
|
private |
Definition at line 1431 of file ROSCommands.cpp.
References IActorInformation::GetActorByID(), TryParseBoolean(), and Vehicle.
Referenced by AddCommands().
|
private |
Definition at line 987 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 253 of file ROSCommands.cpp.
References CommandHandlers, FCommand::CooldownTime, FCommand::Handler, FCommand::LastExecutionTime, and SimulatorLog::Log().
Referenced by SetupROSCommandTopic(), and TryExecuteCommand().
|
private |
Definition at line 743 of file ROSCommands.cpp.
References GetGameWorld(), and SimulatorLog::Log().
Referenced by HandlePrintAllSensors(), HandlePrintAllVehicles(), and HandlePrintAllWalkers().
|
private |
Definition at line 191 of file ROSCommands.cpp.
References Connected, DestroyROSTopic(), Disconnected, and SetupROSCommandTopic().
Referenced by Init().
|
private |
Definition at line 217 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 307 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().