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

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

in case of an overload during brake check if the gear has changed (e.g....

in case of an overload during brake check if the gear has changed (e.g. because vehicle speed is below threshold) - retry again
parent fa5e5fba
No related branches found
No related tags found
No related merge requests found
......@@ -113,7 +113,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
if (retryCount > 10) {
throw new VectoException("HybridStrategy: retry count exceeded! {0}", DebugData);
}
var engaged = DataBus.GearboxInfo.GearEngaged(absTime);
retry = false;
var strategyResponse = Strategy.Request(absTime, dt, outTorque, outAngularVelocity, dryRun);
DebugData.Add($"[HC-R-0-{retryCount}]", strategyResponse);
......@@ -162,6 +162,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
SelectedGear = strategySettings.NextGear;
}
CurrentStrategySettings = strategySettings;
retVal = NextComponent.Request(absTime, dt, outTorque, outAngularVelocity, dryRun);
DebugData.Add($"HC.R-1-{retryCount}", new {
......@@ -207,6 +208,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
continue;
}
if (retVal is ResponseOverload && DataBus.DriverInfo.DrivingAction == DrivingAction.Brake &&
engaged != DataBus.GearboxInfo.GearEngaged(absTime)) {
retryCount++;
retry = true;
Strategy.OperatingpointChangedDuringRequest(absTime, dt, outTorque, outAngularVelocity, dryRun,
retVal);
continue;
}
if (retVal is ResponseInvalidOperatingPoint) {
retryCount++;
retry = true;
......
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