5#include "CoreMinimal.h"
6#include "GameFramework/Actor.h"
7#include "ImuComponent.generated.h"
10class URoveCommManifestWrapper;
13
14
15UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
16class ROVESOSIMULATOR_API UImuComponent :
public UActorComponent
23 UFUNCTION(BlueprintCallable, Category =
"RoveComm")
24 void InitializeRoveComm(URoveCommUDPWrapper* InUDPWrapper, URoveCommManifestWrapper* InManifestWrapper);
27 UPROPERTY(BlueprintReadOnly, Category =
"IMU")
28 FVector LinearAcceleration;
30 UPROPERTY(BlueprintReadOnly, Category =
"IMU")
31 FVector AngularVelocity;
33 UPROPERTY(BlueprintReadOnly, Category =
"IMU")
37 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"IMU")
38 bool bIncludeGravity =
true;
41 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"IMU")
42 float GravityMagnitude = 9.81f;
44 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"RoveComm")
45 URoveCommUDPWrapper* UDPWrapper;
47 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"RoveComm")
48 URoveCommManifestWrapper* ManifestWrapper;
51 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"RoveComm")
52 FString TargetIPAddress =
"127.0.0.1";
54 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"RoveComm")
55 int32 TargetPort = 11000;
59 virtual void BeginPlay() override;
62 virtual void TickComponent(
float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
67 FTransform LastTransform;
71 void UpdateImuData(
float DeltaTime);
74 void TransformToZedImuFrame(
75 const FVector& InLinearAcceleration,
76 const FVector& InAngularVelocity,
77 const FQuat& InOrientation,
78 FVector& OutLinearAcceleration,
79 FVector& OutAngularVelocity,
84 FVector CalculateAngularVelocity(
const FQuat& CurrentQuat,
const FQuat& PreviousQuat,
float DeltaTime);
86 bool bIsRoveCommInitialized;
Blueprintable wrapper class for RoveCommUDP to allow usage in Unreal Engine Blueprints.
Definition RoveCommUDPWrapper.h:25