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

Skip to content
Snippets Groups Projects
Commit ad3a9c8d authored by Michael KRISPER's avatar Michael KRISPER
Browse files

FirstAccelerateOrCoast: Added additional condition to only do...

FirstAccelerateOrCoast: Added additional condition to only do DrivingActionAccelerate to targetVelocity if Acceleration < 0 and we are below or Equal targetSpeed. Otherwise stay in coasting.
parent 947c97f6
No related branches found
No related tags found
No related merge requests found
......@@ -1052,7 +1052,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
DataBus.VehicleInfo.VehicleSpeed.IsGreaterOrEqual(targetVelocity)) {
first = Driver.DrivingActionCoast(absTime, ds, velocityWithOverspeed, gradient);
debug.Add(new { action = "Coast", first });
if (first is ResponseSuccess && first.Driver.Acceleration < 0) {
if (first is ResponseSuccess && first.Driver.Acceleration < 0 && DataBus.VehicleInfo.VehicleSpeed.IsSmallerOrEqual(targetVelocity, 0.1.KMPHtoMeterPerSecond())) {
first = Driver.DrivingActionAccelerate(absTime, ds, targetVelocity, gradient);
debug.Add(new { action = "Coast:(Success & Acc<0) -> Accelerate", first });
}
......
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