RapyutaSimulationPlugins
DifferentialDriveComponentBase.h
Go to the documentation of this file.
1 
13 #pragma once
14 
15 
16 
17 #include "CoreMinimal.h"
18 
20 
21 #include "PhysicsEngine/PhysicsConstraintComponent.h"
22 
23 
24 
25 #include <random>
26 
27 
28 
29 #include "DifferentialDriveComponentBase.generated.h"
30 
31 
32 
33 DECLARE_LOG_CATEGORY_EXTERN(LogDifferentialDriveComponent, Log, All);
34 
35 
36 
48 enum class EDiffDriveWheel : uint8
49 
50 {
51 
52  RIGHT ,
53 
54  LEFT ,
55 
56 };
57 
58 
59 
73 class RAPYUTASIMULATIONPLUGINS_API UDifferentialDriveComponentBase : public URobotVehicleMovementComponent
74 
75 {
76 
77 
78 
79 public:
80 
101  virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
102 
103 
104 
115  virtual void UpdateMovement(float DeltaTime) override;
116 
117 
118 
133  virtual void UpdateOdom(float DeltaTime);
134 
135 
136 
152  virtual float GetWheelVelocity(const EDiffDriveWheel WheelIndex);
153 
154 
155 
164  virtual void Initialize() override;
165 
166 
167 
181  void SetPerimeter();
182 
183 
184 
186 
187 
192  float WheelRadius = 1.f;
193 
194 
195 
197 
198 
203  float WheelSeparationHalf = 1.f;
204 
205 
206 
208 
209 
214  float MaxForce = 1000.f;
215 
216 
217 
218 protected:
219 
221 
222 
227  float WheelPerimeter = 6.28f;
228 
229 
230 
232 
233 
238  float PoseEncoderX = 0.f;
239 
241 
242 
247  float PoseEncoderY = 0.f;
248 
250 
251 
256  float PoseEncoderThetaRad = 0.f;
257 
258 };
259 
URobotVehicleMovementComponent
Base Robot vehicle movement class which is used as part of ARobotVehicle.
Definition: RobotVehicleMovementComponent.h:84
UDifferentialDriveComponentBase
Differential Drive component base class.
Definition: DifferentialDriveComponentBase.h:73
EDiffDriveWheel::RIGHT
@ RIGHT
UMETA(DisplayName = "RIGHT"),.
EDiffDriveWheel::LEFT
@ LEFT
UMETA(DisplayName = "LEFT")
DECLARE_LOG_CATEGORY_EXTERN
DECLARE_LOG_CATEGORY_EXTERN(LogDifferentialDriveComponent, Log, All)
URobotVehicleMovementComponent::TickComponent
virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override
Call UpdateMovement, and UpdateComponentVelocity.
EDiffDriveWheel
EDiffDriveWheel
Wheel type of differential drive.
Definition: DifferentialDriveComponentBase.h:48
URobotVehicleMovementComponent::Initialize
virtual void Initialize()
Initialize noise and odometry.
RobotVehicleMovementComponent.h
Base Robot vehicle movement class which is used as part of ARobotVehicle.
URobotVehicleMovementComponent::UpdateMovement
virtual void UpdateMovement(float InDeltaTime)
Move actor by using SafeMoveUpdatedComponent and SlideAlongSurface.