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 18b6e779 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

Merge branch 'fix/shift_polygons_current_state' into 'amdm2/develop'

Fix missing current state in Clutch Request

See merge request vecto/vecto!89
parents 9a0c6e48 93aaf675
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