12#include "ROSIntegration/Classes/ROSIntegrationGameInstance.h"
15#include "Async/Async.h"
19 PrimaryActorTick.bCanEverTick =
false;
28 UWorld* World = GetWorld();
36 RosInstance = Cast<UROSIntegrationGameInstance>(World->GetGameInstance());
42 Message = MakeShared<ROSMessages::std_msgs::String>();
49 Super::EndPlay(EndPlayReason);
103 AsyncTask(ENamedThreads::AnyThread, [
this]()
128 WeatherTopic = NewObject<UTopic>(UTopic::StaticClass());
129 const FString TopicName =
"/agrarsense/out/weather/";
134 UE_LOG(LogTemp, Warning, TEXT(
"Weather.cpp: Created ROS topic. Topic name: %s"), *TopicName);
void ROSBridgeStateChanged(EROSState ROSState)
ESeason GetCurrentSeason()
void SendWeatherData(FWeatherParameters Parameters)
void UpdateWeather(const FWeatherParameters &WeatherParameters, bool updateToROS)
void InitializeROSTopic()
ESeason GetSeasonForMonth(const int Month)
AWeather(const FObjectInitializer &ObjectInitializer)
const FWeatherParameters Default
FString ExportToJSON(const FString &FileName)
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override
TSharedPtr< ROSMessages::std_msgs::String > Message
FLevelEventDelegate_WeatherChanged OnWeatherChanged
UROSIntegrationGameInstance * RosInstance
FWeatherParameters CurrentWeather
virtual void BeginPlay() override
static UROSHandler * GetROSHandle(const UObject *WorldContextObject)
FROSDelegate_ROState OnROSStateChanged
static FString ExportWeatherToJSON(const FString &FileName, const FWeatherParameters &WeatherParameters)
FString ToStringHumanReadable() const