Add support for Linear Time Invariant StatefulSysModel #1211
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a reusable linear time invariant (LTI) system module to support state space models inside MuJoCo based dynamics, plus two concrete subclasses.
An LTI system has:
where
A,B,C, andDare constant matrices. This form covers many control schemes, filters, delays, and smoothing blocks.Key additions:
LinearTimeInvariantSystem (abstract base class)
A,B,C,D.uvia virtualreadInput.x_dot = A x + B u.y = C x + D u.yvia virtualwriteOutput.configureSecondOrder(wn, zeta, k)configureSecondOrder(wn_vec, zeta_vec, k_vec)for MIMO.Reset.Concrete subclasses
SingleActuatorLTI: SISO actuator model mapped toSingleActuatorMsgPayload.ForceAtSiteLTI: 3 input, 3 output force model mapped toForceAtSiteMsgPayload.SWIG interface
linearTimeInvariantSystem.iwith directors enabled, which means that you can actually crease subclasses ofLinearTimeInvariantSystemimplemented in Python.Tests
Release notes
Verification
Validation performed through automated tests:
First order test
SingleActuatorLTILinearTimeInvariantSystemx_dot = -a x + a uwith step inputu = 1.Second order test
configureSecondOrder(wn, zeta)with critical damping.Both tests integrate into an
MJSceneand are skipped when MuJoCo is disabled.No existing tests were changed.
Documentation
New release notes entries added, headers include detailed doxygen comments.
A scenario using this new model will be added through #1195.
Future work
Add other
SysModelbased on LTI systems. Demonstrate usage in (a) scenario(s).