DAIRLab / dairlib

MIT License
65 stars 26 forks source link

Call CalcForcedDiscreteVariableUpdate in LcmDrivenLoop #345

Closed yangwill closed 1 year ago

yangwill commented 1 year ago

Adding CalcForcedDiscreteVariableUpdate to driven loop to better control discrete updates.

Calling simulator->AdvanceTo() has the potential to call PerStepDiscreteUpdates multiple times, which can be quite costly if there's significant computation. Can also cause issues if there's manual discrete filters. To minimize the chance of a mistake, I'm adding CalcForcedDiscreteVariableUpdate to the driven loop to ensure if we use DeclareForcedDiscreteUpdateEvent, it will only be called once per LcmDrivenLoop AdvanceTo


This change is Reviewable