Files
LuckyWorld/Source/LuckyWorldV2/Private/Robot/PilotComponent/RobotPilotComponent.cpp
JB Briant bf58329dc4 FT - Primitive WebSocket Actuators Control
+ Optionally allow remote control of the robot
+ Direct set of actuators, this should pass by the layer controler for proper interpolation
2025-05-06 19:13:41 +07:00

67 lines
1.5 KiB
C++

#include "Robot/PilotComponent/RobotPilotComponent.h"
#include "Actors/MujocoVolumeActor.h"
#include "Robot/RobotPawn.h"
URobotPilotComponent::URobotPilotComponent()
{
}
void URobotPilotComponent::BeginPlay()
{
Super::BeginPlay();
// Reference owning robot
RobotOwner = Cast<ARobotPawn>(GetOwner());
InitPilotComponent();
}
void URobotPilotComponent::TickComponent(float DeltaTime, enum ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
}
void URobotPilotComponent::InitPilotComponent()
{
if (RobotOwner.Get() && RobotOwner->PhysicsSceneProxy.Get())
{
RobotOwner->PhysicsSceneProxy->BindPostPhysicStepDelegate(this, &URobotPilotComponent::PostPhysicStepUpdate);
}
}
void URobotPilotComponent::PostPhysicStepUpdate(const float SimulationTime)
{
// Overriden in each dedicated RobotPilotComponent
}
FTransform URobotPilotComponent::GetReachableTransform()
{
return FTransform::Identity;
}
bool URobotPilotComponent::GetIsReadyForTraining()
{
// Overriden in individual components
return false;
}
bool URobotPilotComponent::GetIsInRestState()
{
// Overriden in individual components
return true;
}
void URobotPilotComponent::SetRobotTarget(const FTransform& TargetTransformIn)
{
}
void URobotPilotComponent::SetRobotCurrentRewardZone(const FTransform& RewardTransformIn)
{
}
void URobotPilotComponent::ReceiveRemoteCommand(const FRemoteControlPayload& RemoteRobotPayload)
{
}