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

Differential Drive component base class. More...

#include <DifferentialDriveComponentBase.h>

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

Public Member Functions

virtual void TickComponent (float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override
 Call UpdateOdom in addition to update movement. More...
 
virtual void UpdateMovement (float DeltaTime) override
 Calculate wheel velocity from Velocity(member of UMovementComponent) and AngularVelocity, and set by calling SetAngularVelocityTarget. More...
 
virtual void UpdateOdom (float DeltaTime)
 Calculate odometry from Velocity and AngularVelocity. More...
 
virtual float GetWheelVelocity (const EDiffDriveWheel WheelIndex)
 Get the Wheel Velocity [cm/s]. More...
 
virtual void Initialize () override
 Call Super::Initialize() and SetPerimeter. More...
 
void SetPerimeter ()
 SetPerimeter from WheelRadius * 2.f * M_PI. More...
 
- Public Member Functions inherited from URobotVehicleMovementComponent
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 InitData ()
 Call #InitOdom, Calculate MinDistanceToFloor, and. More...
 
void SetMovingPlatform (AActor *platform)
 
bool IsOnMovingPlatform ()
 
void RemoveMovingPlatform ()
 

Public Attributes

float WheelRadius = 1.f
 [cm] More...
 
float WheelSeparationHalf = 1.f
 [cm] More...
 
float MaxForce = 1000.f
 
- Public Attributes inherited from URobotVehicleMovementComponent
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 Attributes

float WheelPerimeter = 6.28f
 [cm] More...
 
float PoseEncoderX = 0.f
 [cm] More...
 
float PoseEncoderY = 0.f
 [cm] More...
 
float PoseEncoderThetaRad = 0.f
 [rad] More...
 
- Protected Attributes inherited from URobotVehicleMovementComponent
float LogLastHit = 0.f
 internal property used to log throttle. More...
 

Additional Inherited Members

- Protected Member Functions inherited from URobotVehicleMovementComponent
virtual bool IsSupportedForNetworking () const override
 

Detailed Description

Differential Drive component base class.

Please check UDifferentialDriveComponent and URRDifferentialDriveComponent as a example child component.

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

Member Function Documentation

◆ GetWheelVelocity()

virtual float UDifferentialDriveComponentBase::GetWheelVelocity ( const EDiffDriveWheel  WheelIndex)
virtual

Get the Wheel Velocity [cm/s].

Parameters
indexindex of wheels

UFUNCTION(BlueprintCallable)

Reimplemented in UDifferentialDriveComponent, and URRDifferentialDriveComponent.

◆ Initialize()

virtual void UDifferentialDriveComponentBase::Initialize ( )
overridevirtual

Call Super::Initialize() and SetPerimeter.

Reimplemented from URobotVehicleMovementComponent.

◆ SetPerimeter()

void UDifferentialDriveComponentBase::SetPerimeter ( )

SetPerimeter from WheelRadius * 2.f * M_PI.

UFUNCTION(BlueprintCallable)

◆ TickComponent()

virtual void UDifferentialDriveComponentBase::TickComponent ( float  DeltaTime,
enum ELevelTick  TickType,
FActorComponentTickFunction *  ThisTickFunction 
)
overridevirtual

Call UpdateOdom in addition to update movement.

Parameters
DeltaTime
TickType
ThisTickFunction
See also

UpdateComponentVelocity

Reimplemented from URobotVehicleMovementComponent.

◆ UpdateMovement()

virtual void UDifferentialDriveComponentBase::UpdateMovement ( float  DeltaTime)
overridevirtual

Calculate wheel velocity from Velocity(member of UMovementComponent) and AngularVelocity, and set by calling SetAngularVelocityTarget.

SetAngularDriveParams as well.

Parameters
DeltaTime

Reimplemented from URobotVehicleMovementComponent.

Reimplemented in UDifferentialDriveComponent, and URRDifferentialDriveComponent.

◆ UpdateOdom()

virtual void UDifferentialDriveComponentBase::UpdateOdom ( float  DeltaTime)
virtual

Calculate odometry from Velocity and AngularVelocity.

Parameters
DeltaTime
Todo:
Calculate odom from wheel rotation.

Member Data Documentation

◆ MaxForce

float UDifferentialDriveComponentBase::MaxForce = 1000.f
Todo:
get data from physics constraints

UPROPERTY(EditAnywhere, BlueprintReadWrite)

◆ PoseEncoderThetaRad

float UDifferentialDriveComponentBase::PoseEncoderThetaRad = 0.f
protected

[rad]

UPROPERTY()

◆ PoseEncoderX

float UDifferentialDriveComponentBase::PoseEncoderX = 0.f
protected

◆ PoseEncoderY

float UDifferentialDriveComponentBase::PoseEncoderY = 0.f
protected

◆ WheelPerimeter

float UDifferentialDriveComponentBase::WheelPerimeter = 6.28f
protected

◆ WheelRadius

float UDifferentialDriveComponentBase::WheelRadius = 1.f

◆ WheelSeparationHalf

float UDifferentialDriveComponentBase::WheelSeparationHalf = 1.f

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