Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 004901de authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

gearbox: do no reduce engage time if it is already set

parent 22c2585f
No related branches found
No related tags found
No related merge requests found
...@@ -177,10 +177,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -177,10 +177,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
_engageTime = absTime + dt; _engageTime = absTime + dt;
} }
if (DataBus.DriverBehavior == DrivingBehavior.Braking && DataBus.BrakePower.IsGreater(0) && outTorque < 0 && if (DataBus.DriverBehavior == DrivingBehavior.Braking && (DataBus.BrakePower.IsGreater(0) || outTorque < 0) &&
DataBus.VehicleSpeed.IsSmaller(Constants.SimulationSettings.ClutchDisengageWhenHaltingSpeed)) { DataBus.VehicleSpeed.IsSmaller(Constants.SimulationSettings.ClutchDisengageWhenHaltingSpeed)) {
_engageTime = absTime + dt; _engageTime = VectoMath.Max(_engageTime, absTime + dt);
Disengaged = true;
return RequestGearDisengaged(absTime, dt, outTorque, outAngularVelocity, dryRun); return RequestGearDisengaged(absTime, dt, outTorque, outAngularVelocity, dryRun);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment