11#include "Internationalization/Regex.h"
12#include "Misc/CommandLine.h"
13#include "Engine/World.h"
26 bConnectToROS = ConnectToROS;
27 bConnectToROSAsync = AsyncROSConnection;
28 ROSBridgeServerHost = Host;
29 ROSBridgeServerPort = Port;
30 bMaxRetries = MaxRetries;
37 Super::BeginDestroy();
67 if (FParse::Param(FCommandLine::Get(), TEXT(
"-no-ros")))
72 if (FParse::Param(FCommandLine::Get(), TEXT(
"-no-ros-async")))
74 AsyncROSConnection =
false;
78 if (FParse::Value(FCommandLine::Get(), TEXT(
"-ros-host-ip="), HostString))
80 FRegexPattern IpPattern(TEXT(
"^\\d+\\.\\d+\\.\\d+\\.\\d+$"));
81 FRegexMatcher Matcher(IpPattern, HostString);
83 if (Matcher.FindNext())
90 if (FParse::Value(FCommandLine::Get(), TEXT(
"-ros-port="), PortString))
92 if (PortString.IsNumeric())
94 Port = FCString::Atoi(*PortString);
98 FString MaxRetriesString;
99 if (FParse::Value(FCommandLine::Get(), TEXT(
"-ros-max-retries="), MaxRetriesString))
101 if (MaxRetriesString.IsNumeric())
103 MaxRetries = FCString::Atoi(*MaxRetriesString);
static void Log(const FString &Message, bool LogToTextFile=true, bool LogToROS=true)
virtual void Init() override
virtual void BeginDestroy() override
void ParseLaunchArguments(bool &ConnectToROS, bool &AsyncROSConnection, FString &Host, int &Port, int &MaxRetries)
virtual void ROSBridgeDisconnected() override
bool DefaultAsyncROSConnection
virtual void ROSBridgeConnected() override
virtual void Shutdown() override
static UROSHandler * GetROSHandle(const UObject *WorldContextObject)
FROSDelegate_ROState OnROSStateChanged