#pragma once #include "CoreMinimal.h" #include "RobotPilotComponent.generated.h" struct FRemoteControlPayload; USTRUCT(BlueprintType) struct FRobotActuators { GENERATED_BODY() // Do we need a prent struct? // What will be in common? }; USTRUCT(BlueprintType) struct FTrainingEpisodeData { GENERATED_BODY() FJsonObject JointsStates; // The total series of joint values per frame FJsonObject ControlsStates; // The total series of joint values per frame FJsonObject JointsStats; // The min / max / mean / std for joints series FJsonObject ControlsStats; // The min / max / mean / std for controls series }; class ARobotPawn; UCLASS(Blueprintable) class LUCKYWORLDV2_API URobotPilotComponent : public UActorComponent { GENERATED_BODY() public: URobotPilotComponent(); virtual void BeginPlay() override; virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; virtual void InitPilotComponent(); virtual void PostPhysicStepUpdate(const float SimulationTime); virtual FTransform GetReachableTransform(); virtual bool GetIsReadyForTraining(); virtual bool GetIsInRestState(); UFUNCTION(BlueprintCallable) virtual void SetRobotTarget(const FTransform& TargetTransformIn); virtual void SetRobotCurrentRewardZone(const FTransform& RewardTransformIn); UFUNCTION() virtual void ReceiveRemoteCommand(const FRemoteControlPayload& RemoteRobotPayload); // Data virtual FJsonObject GetBufferedControlsData(); virtual FJsonObject GetBufferedJointsData(); virtual FTrainingEpisodeData GetTrainingEpisodeData(); protected: // Child class need access // Only to easy access within the component TObjectPtr RobotOwner = nullptr; // ---------------- // ----- ANIM ----- // ---------------- protected: // Child class need access float AnimationStartTime = 0.f; float AnimationDuration = 0.f; };