Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make StateData polymorphic to support alternative state propagation equations #857

Open
juan-g-bonilla opened this issue Nov 25, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@juan-g-bonilla
Copy link
Contributor

Describe your use case
So far, all states x in dynamic objects are represented by a matrix of some dimension m x n, with their derivatives x_dot being given by a matrix of the same dimensions, and first-order propagation forward in time expressed as:

x(t + Dt) = x(t) + Dt*x_dt(t)

However, we could benefit from enabling states that break this pattern. The state of a 3D rotation, for example, can be represented as a quaternion, which is represented by a 4x1 matrix. It's derivative, on the other hand, is an angular velocity of size 3x1. Integrating a quaternion forward in time given an angular velocity also uses a non-standard formula.

Describe alternatives solutions you've considered
I can't think of a way to support similar functionality without relying on hacky preprocessing/postprocessing around the integration functionality to express these special states into the standard format.

Additional context
This issue originally appeared when trying to support MuJoCo as a Basilisk module, whose joints make use of quaternions.

Interestingly, we could make use of this feature to improve how MRPs are handled in Basilisk:

class MRPStateData : public StateData
{
    void propagateState(double dt) override
    {
        super().propagateState(dt);
        // MRP switch here, if needed
    }
};

thus we let the special MRPStateData handle MRP switching and thus avoid having to implement this functionality on state effectors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant