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