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

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

driver strategy: handle the case that another brake action gets more urgent...

driver strategy: handle the case that another brake action gets more urgent during a coasting phase in a braking action (at the end of the interurban cycle)
parent 79826988
No related branches found
No related tags found
No related merge requests found
......@@ -214,12 +214,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
//}
if (CurrentDrivingMode == DrivingMode.DrivingModeBrake) {
var nextAction = GetNextDrivingAction(ds);
if (nextAction != null && !BrakeTrigger.HasEqualTrigger(nextAction) && nextAction.ActionDistance.IsSmallerOrEqual(BrakeTrigger.ActionDistance)) {
BrakeTrigger = nextAction;
}
if (Driver.DataBus.MileageCounter.Distance.IsGreaterOrEqual(BrakeTrigger.TriggerDistance, 1e-3.SI<Meter>())) {
CurrentDrivingMode = DrivingMode.DrivingModeDrive;
NextDrivingAction = null;
DrivingModes[CurrentDrivingMode].ResetMode();
Log.Debug("Switching to DrivingMode DRIVE");
}
}
if (CurrentDrivingMode == DrivingMode.DrivingModeDrive) {
var currentDistance = Driver.DataBus.MileageCounter.Distance;
......
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