From 347edf4ad68bed7c6985d86b280e6384647170c8 Mon Sep 17 00:00:00 2001
From: Markus Quaritsch <markus.quaritsch@tugraz.at>
Date: Tue, 4 Sep 2018 10:15:41 +0200
Subject: [PATCH] add handling for a special case in driver strategy: vehicle
 declerates to new target speed, shift strategy decides to downshift, toruqe
 at gearbox output is negative (due to slope and other resistances), but
 torque at gearbox input gets slightly positive but the gearbox is disengaged
 - no driving force. trying again with roll action after overload fro brake
 action.

---
 .../SimulationComponent/Impl/DefaultDriverStrategy.cs      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
index 582e53a767..99dbc193ff 100644
--- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
+++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/DefaultDriverStrategy.cs
@@ -658,7 +658,12 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
 					DataBus.BrakePower = 0.SI<Watt>();
 					response = Driver.DrivingActionBrake(absTime, ds, DriverStrategy.BrakeTrigger.NextTargetSpeed,
 						gradient, targetDistance: targetDistance);
-				});
+						response.Switch().Case<ResponseOverload>(
+							() => {
+								Log.Info("Brake -> Geearshift -> Overload -> trying roll action (no gear engaged)");
+								response = Driver.DrivingActionRoll(absTime, ds, DriverStrategy.BrakeTrigger.NextTargetSpeed, gradient);
+							});
+					});
 			return response;
 		}
 
-- 
GitLab