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
This commit is contained in:
JB Briant
2025-05-06 19:13:41 +07:00
parent d39a9a4729
commit bf58329dc4
7 changed files with 41 additions and 0 deletions

View File

@ -1,4 +1,6 @@
#include "Robot/PilotComponent/RobotPilotSO100Component.h"
#include "LuckyDataTransferSubsystem.h"
#include "Actors/MujocoVolumeActor.h"
#include "Kismet/KismetMathLibrary.h"
#include "Robot/RobotPawn.h"
@ -85,6 +87,14 @@ void URobotPilotSO100Component::SetRobotCurrentRewardZone(const FTransform& Rewa
bDropZoneIsRight = FVector::DotProduct(RobotOwner->RobotActor->GetActorRotation().Quaternion().GetRightVector(), DirectionToTarget) > 0.f;
}
void URobotPilotSO100Component::ReceiveRemoteCommand(const FRemoteControlPayload& RemoteRobotPayload)
{
for (const auto& [ActuatorName, ActuatorValue] : RemoteRobotPayload.Commands)
{
// Will print an error message if it doesn't exists
RobotOwner->PhysicsSceneProxy->SetActuatorValue(ActuatorName, ActuatorValue);
}
}
void URobotPilotSO100Component::PrintCurrentActuators() const
{