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

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

driverstrategy: switch to braking phase immediately if...

driverstrategy: switch to braking phase immediately if nextdrivingaction.action is set to braking (instead of doing the same calculations again
parent 459e7a23
No related branches found
No related tags found
No related merge requests found
......@@ -664,6 +664,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var brakingDistance = Driver.ComputeDecelerationDistance(DriverStrategy.BrakeTrigger.NextTargetSpeed) +
DefaultDriverStrategy.BrakingSafetyMargin;
DriverStrategy.BrakeTrigger.BrakingStartDistance = DriverStrategy.BrakeTrigger.TriggerDistance - brakingDistance;
if (DriverStrategy.BrakeTrigger.Action == DrivingBehavior.Braking) {
Phase = BrakingPhase.Brake;
}
if (Phase == BrakingPhase.Coast) {
var resp = CheckSwitchingToBraking(ds, currentDistance);
if (resp != null) {
......
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