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

Differential Drive component class. More...

#include <DifferentialDriveComponent.h>

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

Public Member Functions

virtual void UpdateMovement (float DeltaTime) override
 Calculate wheel velocity from Velocity(member of UMovementComponent) and AngularVelocity, and set by calling SetAngularVelocityTarget. More...
 
void SetWheels (UPhysicsConstraintComponent *InWheelLeft, UPhysicsConstraintComponent *InWheelRight)
 Set left and right wheels. More...
 
virtual float GetWheelVelocity (const EDiffDriveWheel WheelIndex) override
 Get the Wheel Velocity [cm/s]. More...
 
- Public Member Functions inherited from UDifferentialDriveComponentBase
virtual void TickComponent (float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override
 Call UpdateOdom in addition to update movement. More...
 
virtual void UpdateOdom (float DeltaTime)
 Calculate odometry from Velocity and AngularVelocity. 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

UPhysicsConstraintComponent * WheelLeft = nullptr
 
UPhysicsConstraintComponent * WheelRight = nullptr
 
- Public Attributes inherited from UDifferentialDriveComponentBase
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...
 

Additional Inherited Members

- Protected Member Functions inherited from URobotVehicleMovementComponent
virtual bool IsSupportedForNetworking () const override
 
- Protected Attributes inherited from UDifferentialDriveComponentBase
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...
 

Detailed Description

Differential Drive component class.

Simulate differential drive by using 2 UPhysicsConstraintComponent.

Calculate wheel rotation from given Velocity(member of UMovementComponent) and AngularVelocity and set by calling SetAngularVelocityTarget

Publish odometry from Velocity and AngularVelocity.

See also
UPhysicsConstraintComponent
SetAngularVelocityTarget
Todo:
Calculate odom from wheel rotation.

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

Member Function Documentation

◆ GetWheelVelocity()

virtual float UDifferentialDriveComponent::GetWheelVelocity ( const EDiffDriveWheel  WheelIndex)
overridevirtual

Get the Wheel Velocity [cm/s].

Parameters
indexindex of wheels

Reimplemented from UDifferentialDriveComponentBase.

◆ SetWheels()

void UDifferentialDriveComponent::SetWheels ( UPhysicsConstraintComponent *  InWheelLeft,
UPhysicsConstraintComponent *  InWheelRight 
)

Set left and right wheels.

Parameters
InWheelLeft
InWheelRight

UFUNCTION(BlueprintCallable)

◆ UpdateMovement()

virtual void UDifferentialDriveComponent::UpdateMovement ( float  DeltaTime)
overridevirtual

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

SetAngularDriveParams as well.

Parameters
DeltaTime
See also
UPhysicsConstraintComponent
SetAngularVelocityTarget
SetAngularDriveParams

Reimplemented from UDifferentialDriveComponentBase.

Member Data Documentation

◆ WheelLeft

UPhysicsConstraintComponent* UDifferentialDriveComponent::WheelLeft = nullptr

◆ WheelRight

UPhysicsConstraintComponent* UDifferentialDriveComponent::WheelRight = nullptr

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