RapyutaSimulationPlugins
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
URobotVehicleMovementComponent Class Reference

Base Robot vehicle movement class which is used as part of ARobotVehicle. More...

#include <RobotVehicleMovementComponent.h>

Inheritance diagram for URobotVehicleMovementComponent:
Inheritance graph
[legend]
Collaboration diagram for URobotVehicleMovementComponent:
Collaboration graph
[legend]

Public Member Functions

void InitAIMovementComp ()
 Init AIMovementComp, which drives the robot kinematically using UE AI Navigation. More...
 
virtual void SetUpdatedComponent (USceneComponent *InNewUpdatedComponent) override
 Assign a #USceneComponent as #UpdatedComponent. More...
 
virtual void Initialize ()
 Initialize noise and odometry. More...
 
virtual void InitData ()
 Call #InitOdom, Calculate MinDistanceToFloor, and. More...
 
void SetMovingPlatform (AActor *platform)
 
bool IsOnMovingPlatform ()
 
void RemoveMovingPlatform ()
 

Public Attributes

ARRBaseRobotOwnerVehicle = nullptr
 
TObjectPtr< URRFloatingMovementComponentAIMovementComp = nullptr
 
FVector AngularVelocity = FVector::ZeroVector
 [deg/s] AngularVelocity control input for [UpdatedComponent] More...
 
FVector DesiredMovement = FVector::ZeroVector
 Desired position calculated from deltatime and UpdatedComponent::ComponentVelocity. More...
 
FQuat DesiredRotation = FQuat::Identity
 Desired orientation calculated from deltatime and AngularVelocity. More...
 
float RayOffsetUp = 10.f
 Ray start Z offset. Value must be > possible penetration of objects in contact point, in one tick. More...
 
float RayOffsetDown = 20.f
 Ray end Z offset. More...
 
bool bAdaptToSurfaceBelow = true
 to activate/deactivate floor checks to stick the robot on its surface below More...
 
int8 InversionFactor = 1
 
float MinDistanceToFloor = 0.f
 [cm] Z distance between the robot root location and the floor, used when less than 3 contact points are defined More...
 
float FallingSpeed = 100.f
 [cm/s] How much the robot falls if no floor beneath ( FallingSpeed * DeltaTime ) More...
 
URRBaseOdomComponentOdomComponent = nullptr
 Odometry source. More...
 

Protected Member Functions

virtual bool IsSupportedForNetworking () const override
 
virtual void TickComponent (float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override
 Call UpdateMovement, and UpdateComponentVelocity. More...
 
virtual void UpdateMovement (float InDeltaTime)
 Move actor by using SafeMoveUpdatedComponent and SlideAlongSurface. More...
 

Protected Attributes

float LogLastHit = 0.f
 internal property used to log throttle. More...
 

Private Attributes

AActor * MovingPlatform = nullptr
 The platform below the robot, e.g. elevator. More...
 
FVector LastPlatformLocation = FVector::ZeroVector
 
FQuat LastPlatformRotation = FQuat::Identity
 
TArray< USceneComponent * > ContactPoints
 List all scene components on the pawn. that have the tag "ContactPoint". This is used to adapt the robot pose based on the. More...
 

Detailed Description

Base Robot vehicle movement class which is used as part of ARobotVehicle.

Robot moves based on the Velocity(member of UMovementComponent) and AngularVelocity without considering physics.

If Robot bumped into something, try to slide along it.

If bAdaptToSurfaceBelow is true, robot will follow the pawn movement under the robot which has been defined as the

MovingPlatform (e.g. elevators), it will also adapt its pose to the floor surface configuration (e.g. slopes)

Publish odometry from world origin or initial pose.

See also
UPawnMovementComponent
Todo:
Support 3D movement.
Todo:
Expose odom covariance parameter.

UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))

Member Function Documentation

◆ InitAIMovementComp()

void URobotVehicleMovementComponent::InitAIMovementComp ( )

Init AIMovementComp, which drives the robot kinematically using UE AI Navigation.

UFUNCTION(BlueprintCallable)

◆ InitData()

virtual void URobotVehicleMovementComponent::InitData ( )
virtual

Call #InitOdom, Calculate MinDistanceToFloor, and.

Add all actors in PawnOwner which has tag "ContactPoints" to ContactPoints

UFUNCTION(BlueprintCallable)

◆ Initialize()

virtual void URobotVehicleMovementComponent::Initialize ( )
virtual

Initialize noise and odometry.

UFUNCTION(BlueprintCallable)

Reimplemented in UDifferentialDriveComponentBase.

◆ IsOnMovingPlatform()

bool URobotVehicleMovementComponent::IsOnMovingPlatform ( )

◆ IsSupportedForNetworking()

virtual bool URobotVehicleMovementComponent::IsSupportedForNetworking ( ) const
inlineoverrideprotectedvirtual

◆ RemoveMovingPlatform()

void URobotVehicleMovementComponent::RemoveMovingPlatform ( )

◆ SetMovingPlatform()

void URobotVehicleMovementComponent::SetMovingPlatform ( AActor *  platform)

◆ SetUpdatedComponent()

virtual void URobotVehicleMovementComponent::SetUpdatedComponent ( USceneComponent *  InNewUpdatedComponent)
overridevirtual

Assign a #USceneComponent as #UpdatedComponent.

Parameters
InNewUpdatedComponent
See also

SetUpdatedComponent

◆ TickComponent()

virtual void URobotVehicleMovementComponent::TickComponent ( float  DeltaTime,
enum ELevelTick  TickType,
FActorComponentTickFunction *  ThisTickFunction 
)
overrideprotectedvirtual

Call UpdateMovement, and UpdateComponentVelocity.

Parameters
DeltaTime
TickType
ThisTickFunction
See also

UpdateComponentVelocity

Reimplemented in URRKinematicTricycleDriveComponent, and UDifferentialDriveComponentBase.

◆ UpdateMovement()

virtual void URobotVehicleMovementComponent::UpdateMovement ( float  InDeltaTime)
protectedvirtual

Move actor by using SafeMoveUpdatedComponent and SlideAlongSurface.

Calculate DesiredMovement and DesiredRotation from deltatime, UpdatedComponent and AngularVelocity.

If bAdaptToSurfaceBelow is true, robot will follow the pawn movement under the robot with tag "ContactPoints".

Please check the .cpp file for detailed implementation to follow platform.

Parameters
InDeltaTime
See also

SafeMoveUpdatedComponent

See also

SlideAlongSurface

See also

UpdatedComponent

Reimplemented in UDifferentialDriveComponentBase, UDifferentialDriveComponent, and URRDifferentialDriveComponent.

Member Data Documentation

◆ AIMovementComp

TObjectPtr<URRFloatingMovementComponent> URobotVehicleMovementComponent::AIMovementComp = nullptr

◆ AngularVelocity

FVector URobotVehicleMovementComponent::AngularVelocity = FVector::ZeroVector

[deg/s] AngularVelocity control input for [UpdatedComponent]

UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Velocity)

◆ bAdaptToSurfaceBelow

bool URobotVehicleMovementComponent::bAdaptToSurfaceBelow = true

to activate/deactivate floor checks to stick the robot on its surface below

UPROPERTY(EditAnywhere, BlueprintReadWrite)

◆ ContactPoints

TArray<USceneComponent*> URobotVehicleMovementComponent::ContactPoints
private

List all scene components on the pawn. that have the tag "ContactPoint". This is used to adapt the robot pose based on the.

floor surface configuration.

UPROPERTY(VisibleAnywhere)

◆ DesiredMovement

FVector URobotVehicleMovementComponent::DesiredMovement = FVector::ZeroVector

Desired position calculated from deltatime and UpdatedComponent::ComponentVelocity.

See also
UpdatedComponent

UPROPERTY(Transient)

◆ DesiredRotation

FQuat URobotVehicleMovementComponent::DesiredRotation = FQuat::Identity

Desired orientation calculated from deltatime and AngularVelocity.

UPROPERTY(Transient)

◆ FallingSpeed

float URobotVehicleMovementComponent::FallingSpeed = 100.f

[cm/s] How much the robot falls if no floor beneath ( FallingSpeed * DeltaTime )

UPROPERTY(EditAnywhere, BlueprintReadWrite)

◆ InversionFactor

int8 URobotVehicleMovementComponent::InversionFactor = 1
Todo:
is this necessary?

UPROPERTY()

◆ LastPlatformLocation

FVector URobotVehicleMovementComponent::LastPlatformLocation = FVector::ZeroVector
private

◆ LastPlatformRotation

FQuat URobotVehicleMovementComponent::LastPlatformRotation = FQuat::Identity
private

◆ LogLastHit

float URobotVehicleMovementComponent::LogLastHit = 0.f
protected

internal property used to log throttle.

UPROPERTY()

◆ MinDistanceToFloor

float URobotVehicleMovementComponent::MinDistanceToFloor = 0.f

[cm] Z distance between the robot root location and the floor, used when less than 3 contact points are defined

UPROPERTY(VisibleAnywhere)

◆ MovingPlatform

AActor* URobotVehicleMovementComponent::MovingPlatform = nullptr
private

The platform below the robot, e.g. elevator.

UPROPERTY(VisibleAnywhere)

◆ OdomComponent

URRBaseOdomComponent* URobotVehicleMovementComponent::OdomComponent = nullptr

◆ OwnerVehicle

ARRBaseRobot* URobotVehicleMovementComponent::OwnerVehicle = nullptr

◆ RayOffsetDown

float URobotVehicleMovementComponent::RayOffsetDown = 20.f

Ray end Z offset.

Rays go from ContactPoint+RayOffsetUp to ContactPoint-RayOffsetDown

UPROPERTY(EditAnywhere, BlueprintReadWrite)

◆ RayOffsetUp

float URobotVehicleMovementComponent::RayOffsetUp = 10.f

Ray start Z offset. Value must be > possible penetration of objects in contact point, in one tick.

UPROPERTY(EditAnywhere, BlueprintReadWrite)


The documentation for this class was generated from the following file: