Files
LuckyWorld/Source/LuckyWorldV2/Public/Robot/PilotComponent/RobotPilotComponent.h

71 lines
1.9 KiB
C
Raw Normal View History

#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);
2025-05-03 01:45:06 +07:00
virtual FTransform GetReachableTransform();
2025-05-04 01:04:44 +07:00
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<ARobotPawn> RobotOwner = nullptr;
// ----------------
// ----- ANIM -----
// ----------------
protected: // Child class need access
float AnimationStartTime = 0.f;
float AnimationDuration = 0.f;
};