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

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

Merge branch 'feature/VECTO-238-look-ahead-coasting' of...

Merge branch 'feature/VECTO-238-look-ahead-coasting' of git+ssh://129.27.107.191:2211/vecto-sim into feature/VECTO-238-look-ahead-coasting
parents 67494b18 d19ef8cf
No related branches found
No related tags found
No related merge requests found
......@@ -274,8 +274,10 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
var currentSpeed = Driver.DataBus.VehicleSpeed;
// distance until halt
var lookaheadDistance = Formulas.DecelerationDistance(currentSpeed, 0.SI<MeterPerSecond>(),
Driver.DriverData.LookAheadCoasting.Deceleration);
//var lookaheadDistance = Formulas.DecelerationDistance(currentSpeed, 0.SI<MeterPerSecond>(),
// Driver.DriverData.LookAheadCoasting.Deceleration);
var lookaheadDistance = (currentSpeed.Value() * 3.6 * 10).SI<Meter>();
lookaheadDistance = VectoMath.Max(2 * ds, 1.2 * lookaheadDistance);
var lookaheadData = Driver.DataBus.LookAhead(lookaheadDistance);
......@@ -287,8 +289,8 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
: entry.VehicleTargetSpeed;
if (nextTargetSpeed < currentSpeed) {
var coastingDistance = ComputeCoastingDistance(currentSpeed, entry);
if (!Driver.DriverData.LookAheadCoasting.Enabled ||
currentSpeed < Driver.DriverData.LookAheadCoasting.MinSpeed ||
if ( /*!Driver.DriverData.LookAheadCoasting.Enabled ||
currentSpeed < Driver.DriverData.LookAheadCoasting.MinSpeed || */
coastingDistance < 0) {
var brakingDistance = Driver.ComputeDecelerationDistance(nextTargetSpeed) + BrakingSafetyMargin;
Log.Debug(
......
......@@ -43,6 +43,11 @@ namespace TUGraz.VectoCore.Tests.Integration.DriverStrategy
TestCase(60, 35, 5.3),
TestCase(50, 47.5, -2.1),
TestCase(65, 62.5, -0.8),
TestCase(60, 50, 5.6),
TestCase(80, 40, 4.0),
TestCase(65, 60, 4.7),
TestCase(70, 62.5, 4.6),
TestCase(75, 65, 4.5),
]
public void Truck_Coasting_Test(double v1, double v2, double slope)
{
......
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