Movement Components refactor - #19
Conversation
|
|
||
| #pragma once | ||
|
|
||
| #include <random> |
| ATurtlebotBurger(const FObjectInitializer& ObjectInitializer); | ||
|
|
||
| UPROPERTY(EditAnywhere, BlueprintReadWrite) | ||
| UDifferentialDriveComponent* DifferentialDriveComponent = nullptr; |
There was a problem hiding this comment.
can't we use robotMoveComponent in base class?
|
@praphulkallakuri I could see this PR is initiated with a couple of commits related to Lidar balancing and it looks like overlapping with #18. |
dadc596 to
71a1955
Compare
|
|
||
| FVector position = UpdatedComponent->ComponentVelocity * DeltaTime; | ||
| FQuat DeltaRotation(FVector::ZAxisVector, AngularVelocity.Z * DeltaTime); | ||
| FQuat DeltaRotation(FVector::ZAxisVector, InversionFactor * AngularVelocity.Z * DeltaTime); |
There was a problem hiding this comment.
@yuokamoto not sure why AMRVehicle moves in a different style from TurtleBotBurger tho?
@praphulkallakuri And thus, based on the rationale, we might need a more specific name for InversionFactor I suppose.
|
some resolved comment is not resolved yet. please double check. |
| UPROPERTY(VisibleAnywhere) | ||
| bool IsInitialized = false; | ||
|
|
||
| protected: |
There was a problem hiding this comment.
whyd did you separated protected?
|
I got following error when play the turtlebot3-UE. Did yout test with turtlebot3 as well? UE4Editor!_start() |
| InitialTransform.SetRotation(FQuat(PawnOwner->GetActorRotation())); | ||
|
|
||
| PreviousTransform = FTransform(FQuat(0,0,0,1), FVector(0,0,0), FVector(1,1,1)); | ||
| PreviousTransform = FTransform(FQuat::Identity, FVector::ZeroVector, FVector::OneVector); |
There was a problem hiding this comment.
Sorry, I looked too quickly, this could be actually FTransform::Identity
| void ATurtlebotBurger::InitializeMoveComponent() | ||
| { | ||
| DifferentialDriveComponent = NewObject<UDifferentialDriveComponent>(this, TEXT("DifferentialDriveComponent")); |
There was a problem hiding this comment.
@praphul Kallakuri For the crash that Yu might have just noted, though ATurtlebotBurger seems to be not using RobotVehicleMoveComponent, you could call Super::InitializeMoveComponent() here to initialize it, since in our parent class ARobotVehicle it is currently hooked up to be initialized.
| void ATurtlebotBurger::InitializeMoveComponent() | |
| { | |
| DifferentialDriveComponent = NewObject<UDifferentialDriveComponent>(this, TEXT("DifferentialDriveComponent")); | |
| void ATurtlebotBurger::InitializeMoveComponent() | |
| { | |
| Super::InitializeMoveComponent(); | |
| DifferentialDriveComponent = NewObject<UDifferentialDriveComponent>(this, TEXT("DifferentialDriveComponent")); |
Call Super::, which initializes RobotVehicleMoveComponent [ATurtlebotBurger] definition: cleaning up
|
A rebase over main branch |
* Move components duplication refactored for RobotVehicle class and AMRVehicle class * Add StatePublisher class * Add InversionFactor variable in RobotVehicleMovementComponent Co-authored-by: duc <ducanh.than@rapyuta-robotics.com>
Refactored code in
DifferentialDriveComponentin TB classclass URobotVehicleMovementComponentmaking it base classThanks to @Tadinu for help !!