AVSLab / basilisk

Astrodynamics simulation framework
https://hanspeterschaub.info/basilisk
ISC License
147 stars 61 forks source link

Feature/bsk 857 polymorphic state data #858

Open juan-g-bonilla opened 19 hours ago

juan-g-bonilla commented 19 hours ago

Description

StateData was made polymorphic, StateData::propagateState is now virtual.

This also required improvements to how the integrators work. ExtendedStateVector was given additional methods and updated to handle the polymorphic StateData. Similarly, DynParamManager had to be updated (registerState is now a templated method for different state classes, for example). Unfortunately, this means a SWIG file is now necessary for DynParamManager (templated code needs some extra massaging in SWIG), which in turn means a lot of SWIG interface files must be updated to use this new SWIG file.

I'm a good boy scout, so I also tried to clean up code and add extra docstrings in these classes.

Verification

Commit 8976004 removes support for operator+ and operator* on StateData, that test_stateArchitecture depended on. This test has been updated to use other, equivalent, methods.

No new tests added. Essentially all other Basilisk tests use StateData and integration, thus these tests passing should prove the refactored system works as expected. For now, only one StateData class appears in Basilisk (with the standard propagation function), and that should be shown to work. New StateData classes should be tested as they are implemented.

Documentation

No changes. API remains very similar: by default DynParamManager assumes you want to create a standard StateData. The state system is not discussed on the prosaic documentation, thus no changes are needed.

Future work

Implement custom StateData classes, such as the MRPStateData or QuaternionStateData classes described in #857