From 3c354abcec4d3d995f24c9d4c06dd668da9ed872 Mon Sep 17 00:00:00 2001 From: duc Date: Mon, 13 Dec 2021 15:36:56 +0900 Subject: [PATCH] [ATurtlebotBurger::InitializeMoveComponent()] Call Super::, which initializes RobotVehicleMoveComponent [ATurtlebotBurger] definition: cleaning up --- .../Robots/Turtlebot3/TurtlebotBurger.cpp | 1 + .../Robots/Turtlebot3/TurtlebotBurger.h | 26 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Source/RapyutaSimulationPlugins/Private/Robots/Turtlebot3/TurtlebotBurger.cpp b/Source/RapyutaSimulationPlugins/Private/Robots/Turtlebot3/TurtlebotBurger.cpp index 5fd5dbbc..fbb9deb6 100644 --- a/Source/RapyutaSimulationPlugins/Private/Robots/Turtlebot3/TurtlebotBurger.cpp +++ b/Source/RapyutaSimulationPlugins/Private/Robots/Turtlebot3/TurtlebotBurger.cpp @@ -18,6 +18,7 @@ ATurtlebotBurger::ATurtlebotBurger(const FObjectInitializer& ObjectInitializer) void ATurtlebotBurger::InitializeMoveComponent() { + Super::InitializeMoveComponent(); DifferentialDriveComponent = NewObject(this, TEXT("DifferentialDriveComponent")); } diff --git a/Source/RapyutaSimulationPlugins/Public/Robots/Turtlebot3/TurtlebotBurger.h b/Source/RapyutaSimulationPlugins/Public/Robots/Turtlebot3/TurtlebotBurger.h index 4d74fb36..c60918ca 100644 --- a/Source/RapyutaSimulationPlugins/Public/Robots/Turtlebot3/TurtlebotBurger.h +++ b/Source/RapyutaSimulationPlugins/Public/Robots/Turtlebot3/TurtlebotBurger.h @@ -30,7 +30,6 @@ class RAPYUTASIMULATIONPLUGINS_API ATurtlebotBurger : public ARobotVehicle virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; -public: // Called every frame virtual void Tick(float DeltaTime) override; @@ -38,45 +37,44 @@ class RAPYUTASIMULATIONPLUGINS_API ATurtlebotBurger : public ARobotVehicle virtual void Init(); UPROPERTY(EditAnywhere, BlueprintReadWrite) - UStaticMeshComponent* Base; + UStaticMeshComponent* Base = nullptr; UPROPERTY(EditAnywhere, BlueprintReadWrite) - UStaticMeshComponent* LidarSensor; + UStaticMeshComponent* LidarSensor = nullptr; UPROPERTY(EditAnywhere, BlueprintReadWrite) - UStaticMeshComponent* WheelLeft; + UStaticMeshComponent* WheelLeft = nullptr; UPROPERTY(EditAnywhere, BlueprintReadWrite) - UStaticMeshComponent* WheelRight; + UStaticMeshComponent* WheelRight = nullptr; UPROPERTY(EditAnywhere, BlueprintReadWrite) - UStaticMeshComponent* CasterBack; + UStaticMeshComponent* CasterBack = nullptr; UPROPERTY(EditAnywhere, BlueprintReadWrite) - UPhysicsConstraintComponent* Base_LidarSensor; + UPhysicsConstraintComponent* Base_LidarSensor = nullptr; UPROPERTY(EditAnywhere, BlueprintReadWrite) - UPhysicsConstraintComponent* Base_WheelLeft; + UPhysicsConstraintComponent* Base_WheelLeft = nullptr; UPROPERTY(EditAnywhere, BlueprintReadWrite) - UPhysicsConstraintComponent* Base_WheelRight; + UPhysicsConstraintComponent* Base_WheelRight = nullptr; UPROPERTY(EditAnywhere, BlueprintReadWrite) - UPhysicsConstraintComponent* Base_CasterBack; + UPhysicsConstraintComponent* Base_CasterBack = nullptr; UPROPERTY(EditAnywhere, BlueprintReadWrite) - float MaxForce = 1000; + float MaxForce = 1000.f; UPROPERTY(EditAnywhere, BlueprintReadWrite) - UMaterial* VehicleMaterial; + UMaterial* VehicleMaterial = nullptr; UPROPERTY(EditAnywhere, BlueprintReadWrite) - UMaterial* BallMaterial; + UMaterial* BallMaterial = nullptr; UPROPERTY(VisibleAnywhere) bool IsInitialized = false; -protected: UFUNCTION() void SetupConstraintsAndPhysics();