fixed bug not getting max steering when applying commands
This commit is contained in:
parent
04ea5f4e55
commit
a96c5bbdf5
|
@ -124,16 +124,16 @@ void FAckermannController::RunControlReverse() {
|
|||
// Change of driving direction to forward.
|
||||
bReverse = false;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (FMath::Sign(VehicleSpeed) * FMath::Sign(UserTargetPoint.Speed) == -1) {
|
||||
// Requested for change of driving direction.
|
||||
// First we have to come to full stop before changing driving direction
|
||||
UE_LOG(LogCarla, Log, TEXT("Requested change of driving direction. First going to full stop"));
|
||||
TargetSpeed = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FAckermannController::RunControlSpeed() {
|
||||
SpeedController.SetTargetPoint(TargetSpeed);
|
||||
SpeedControlAccelDelta = SpeedController.Run(VehicleSpeed, DeltaTime);
|
|
@ -193,6 +193,9 @@ void ACarlaWheeledVehicle::BeginPlay()
|
|||
MovementComponent->WheelSetups = NewWheelSetups;
|
||||
|
||||
LastPhysicsControl = GetVehiclePhysicsControl();
|
||||
|
||||
// Update physics in the Ackermann Controller
|
||||
AckermannController.UpdateVehiclePhysics(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue