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

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

driverActionBrake: only adapt deceleration if already braking with max. deceleration

parent 10d071ac
No related branches found
No related tags found
No related merge requests found
......@@ -317,7 +317,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var operatingPoint = ComputeAcceleration(ds, nextTargetSpeed);
if (operatingPoint.Acceleration < 0) {
//if (operatingPoint.Acceleration.IsSmaller(0)) {
// if we should brake with the max. deceleration and the deceleration changes within the current interval, take the larger deceleration...
if (operatingPoint.Acceleration.IsEqual(DriverData.AccelerationCurve.Lookup(DataBus.VehicleSpeed).Deceleration)) {
var v2 = DataBus.VehicleSpeed + operatingPoint.Acceleration * operatingPoint.SimulationInterval;
var nextAcceleration = DriverData.AccelerationCurve.Lookup(v2).Deceleration;
var tmp = ComputeTimeInterval(VectoMath.Min(operatingPoint.Acceleration, nextAcceleration),
......
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