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();
62 if (FParse::Param(FCommandLine::Get(), TEXT(
"-no-ros")))
67 if (FParse::Param(FCommandLine::Get(), TEXT(
"-no-ros-async")))
69 AsyncROSConnection =
false;
73 if (FParse::Value(FCommandLine::Get(), TEXT(
"-ros-host-ip="), HostString))
75 FRegexPattern IpPattern(TEXT(
"^\\d+\\.\\d+\\.\\d+\\.\\d+$"));
76 FRegexMatcher Matcher(IpPattern, HostString);
78 if (Matcher.FindNext())
85 if (FParse::Value(FCommandLine::Get(), TEXT(
"-ros-port="), PortString))
87 if (PortString.IsNumeric())
89 Port = FCString::Atoi(*PortString);
93 FString MaxRetriesString;
94 if (FParse::Value(FCommandLine::Get(), TEXT(
"-ros-max-retries="), MaxRetriesString))
96 if (MaxRetriesString.IsNumeric())
98 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
static UROSHandler * GetROSHandle(const UObject *WorldContextObject)
FROSDelegate_ROState OnROSStateChanged