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

Skip to content
Snippets Groups Projects
Commit cd1417a8 authored by Markus QUARITSCH's avatar Markus QUARITSCH
Browse files

bugfix: correct calculation of acceleration in case simulation intervals are split up

parent 615a461d
No related branches found
No related tags found
No related merge requests found
......@@ -154,7 +154,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
targetSpeed = 0.KMPHtoMeterPerSecond();
}
var deltaV = targetSpeed - DataBus.VehicleSpeed;
var deltaT = CycleIterator.RightSample.Time - CycleIterator.LeftSample.Time;
var deltaT = CycleIterator.RightSample.Time - absTime;
if (DataBus.VehicleSpeed.IsSmaller(0)) {
throw new VectoSimulationException("vehicle velocity is smaller than zero");
......
......@@ -32,6 +32,7 @@
using NUnit.Framework;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using TUGraz.VectoCommon.Exceptions;
using TUGraz.VectoCommon.Models;
......@@ -60,6 +61,13 @@ namespace TUGraz.VectoCore.Tests.Models.Simulation
[TestFixture]
public class MeasuredSpeedModeTest
{
[OneTimeSetUp]
public void Init()
{
Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory);
}
/// <summary>
/// Test if the cycle file can be read.
/// </summary>
......
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