Agrarsense
AgrarsenseGameInstance.h
Go to the documentation of this file.
1// Copyright (c) 2023 FrostBit Software Lab at the Lapland University of Applied Sciences
2//
3// This work is licensed under the terms of the MIT license.
4// For a copy, see <https://opensource.org/licenses/MIT>.
5
6#pragma once
7
8#include "Engine/GameInstance.h"
9#include "ROSIntegrationGameInstance.h"
10
11#include "AgrarsenseGameInstance.generated.h"
12
13/*
14* UAgrarsenseGameInstance manages the game instance for AGRARSENSE.
15* It extends UROSIntegrationGameInstance, enabling integration with ROSIntegration.
16* See: https://github.com/code-iai/ROSIntegration
17*/
18UCLASS(config = AgrarsenseSettings)
19class AGRARSENSE_API UAgrarsenseGameInstance : public UROSIntegrationGameInstance
20{
21 GENERATED_BODY()
22
23public:
24
25 virtual void Init() override;
26
27 virtual void BeginDestroy() override;
28
29 virtual void Shutdown() override;
30
31 UPROPERTY(Config)
32 bool DefaultConnectToROS = true;
33
34 UPROPERTY(Config)
35 bool DefaultAsyncROSConnection = true;
36
37 UPROPERTY(Config)
38 FString DefaultROSHost = "127.0.0.1";
39
40 UPROPERTY(Config)
41 int32 DefaultROSPort = 9090;
42
43 UPROPERTY(Config)
44 int32 DefaultROSMaxRetries = 3;
45
46private:
47
51 virtual void ROSBridgeConnected() override;
52
56 virtual void ROSBridgeDisconnected() override;
57
61 void ParseLaunchArguments(bool& ConnectToROS, bool& AsyncROSConnection, FString& Host, int32& Port, int32& MaxRetries);
62};