Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 93aaf675 authored by David AMO GONZALEZ's avatar David AMO GONZALEZ
Browse files

Fix missing current state in Clutch Request

parent 9a0c6e48
No related branches found
No related tags found
No related merge requests found
......@@ -188,17 +188,17 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
torqueIn = outTorque * avgOutAngularVelocity / avgInAngularVelocity;
}
var retVal = NextComponent.Request(absTime, dt, torqueIn, angularVelocityIn, dryRun);
var response = NextComponent.Request(absTime, dt, torqueIn, angularVelocityIn, dryRun);
if (!dryRun) {
CurrentState.SetState(torqueIn, angularVelocityIn, outTorque, outAngularVelocity);
CurrentState.ClutchLoss = torqueIn * avgInAngularVelocity - outTorque * avgOutAngularVelocity;
CurrentState.ICEOn = iceOn;
CurrentState.ICEOnSpeed = DataBus.EngineInfo.EngineSpeed;
}
retVal.Clutch.PowerRequest = outTorque *
((PreviousState.OutAngularVelocity ?? 0.SI<PerSecond>()) + CurrentState.OutAngularVelocity) / 2.0;
retVal.Clutch.OutputSpeed = outAngularVelocity;
return retVal;
response.Clutch.PowerRequest = outTorque * ((PreviousState.OutAngularVelocity ?? 0.SI<PerSecond>()) + outAngularVelocity) / 2.0;
response.Clutch.OutputSpeed = outAngularVelocity;
return response;
}
protected virtual void AddClutchLoss(NewtonMeter torque, PerSecond angularVelocity, bool allowSlipping, out NewtonMeter torqueIn,
......
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