10#include "GeoReferencingSystem.h"
11#include "Kismet/GameplayStatics.h"
12#include "Engine/World.h"
17 PrimaryActorTick.bCanEverTick =
false;
25 ROSMessages::geometry_msgs::Transform transformMsg;
26 TransformMessage = MakeShared<ROSMessages::geometry_msgs::Transform>(transformMsg);
37 SetActorEnableCollision(
false);
52 Super::EndPlay(EndPlayReason);
57 Super::CreateROSTopic();
64 FString TopicName = FString::Printf(TEXT(
"/agrarsense/out/sensors/%s"), *
GetSensorIdentifier());
65 int32 LastSlashIndex = TopicName.Find(TEXT(
"/"), ESearchCase::IgnoreCase, ESearchDir::FromEnd);
66 if (LastSlashIndex != INDEX_NONE)
68 TopicName = TopicName.Left(LastSlashIndex) + TEXT(
"/gnss");
72 TopicName += TEXT(
"/gnss");
75 GnssTopic = NewObject<UTopic>(UTopic::StaticClass());
100 ROSTopic->ConditionalBeginDestroy();
107 AActor* TargetActor =
Target.Get();
113 FTransform CurrentTransform = TargetActor->GetTransform();
114 FVector CurrentPos = CurrentTransform.GetLocation();
115 FQuat CurrentRot = CurrentTransform.GetRotation();
150 double Latitude = GeographicCoordinates.Latitude;
151 double Longitude = GeographicCoordinates.Longitude;
152 double Altitude = GeographicCoordinates.Altitude;
155 FString GnssDataString = FString::Printf(TEXT(
"%f, %f, %f"), Latitude, Longitude, Altitude);
static auto BindTick(ObjectType *Object, FunctionType Function)
UROSIntegrationGameInstance * ROSInstance
bool CanSimulateSensor() const
FString GetSensorIdentifier() const
void SetSimulateSensor(bool SimulateSensor)
UTopic * GetROSTopic() const
FORCEINLINE bool IsROSConnected() const
static void RemoveTick(FTickEntry TickEntry)
static FTickEntry AddTick(UObject *Object, std::function< void(float)> Function, ETickType Type)
static FGeographicCoordinates UnrealToGeographicCoordinates(AGeoReferencingSystem *GeoReferencingSystem, const FVector &Position)