Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

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

distance cycle: avoid driving beyond end of cycle

parent 5dc2d323
Branches
Tags
No related merge requests found
...@@ -119,7 +119,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -119,7 +119,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
default: default:
return retVal; return retVal;
} }
if (ds.IsEqual(newds, 1e-3.SI<Meter>())) { if (newds.IsEqual(0, 1e-3) || ds.IsEqual(newds, 1e-3.SI<Meter>())) {
return retVal; return retVal;
} }
Log.Debug("Exceeding next ActionDistance at {0}. Reducing max Distance to {1}", nextAction.ActionDistance, newds); Log.Debug("Exceeding next ActionDistance at {0}. Reducing max Distance to {1}", nextAction.ActionDistance, newds);
......
...@@ -189,6 +189,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl ...@@ -189,6 +189,9 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
return cycleIterator.RightSample.Distance; return cycleIterator.RightSample.Distance;
} }
} while (cycleIterator.RightSample.Distance < PreviousState.Distance + ds && cycleIterator.MoveNext()); } while (cycleIterator.RightSample.Distance < PreviousState.Distance + ds && cycleIterator.MoveNext());
if (cycleIterator.LastEntry) {
return cycleIterator.RightSample.Distance;
}
return null; return null;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment