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

Differential Drive component class. More...

#include <RRDifferentialDriveComponent.h>

Inheritance diagram for URRDifferentialDriveComponent:
Inheritance graph
[legend]
Collaboration diagram for URRDifferentialDriveComponent:
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 (URRPhysicsJointComponent *InWheelLeft, URRPhysicsJointComponent *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

URRPhysicsJointComponentWheelLeft = nullptr
 
URRPhysicsJointComponentWheelRight = 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 URRPhysicsJointComponent.

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

Publish odometry from wheel rotation.

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

Member Function Documentation

◆ GetWheelVelocity()

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

Get the Wheel Velocity [cm/s].

Parameters
indexindex of wheels

Reimplemented from UDifferentialDriveComponentBase.

◆ SetWheels()

void URRDifferentialDriveComponent::SetWheels ( URRPhysicsJointComponent InWheelLeft,
URRPhysicsJointComponent InWheelRight 
)

Set left and right wheels.

Parameters
InWheelLeft
InWheelRight

UFUNCTION(BlueprintCallable)

◆ UpdateMovement()

virtual void URRDifferentialDriveComponent::UpdateMovement ( float  DeltaTime)
overridevirtual

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

Parameters
DeltaTime

Reimplemented from UDifferentialDriveComponentBase.

Member Data Documentation

◆ WheelLeft

URRPhysicsJointComponent* URRDifferentialDriveComponent::WheelLeft = nullptr

◆ WheelRight

URRPhysicsJointComponent* URRDifferentialDriveComponent::WheelRight = nullptr

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