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

Implementing dynamic cast for CostStack, Integrator and Dynamics #204

Closed
edantec opened this issue Sep 19, 2024 · 1 comment
Closed

Implementing dynamic cast for CostStack, Integrator and Dynamics #204

edantec opened this issue Sep 19, 2024 · 1 comment

Comments

@edantec
Copy link
Collaborator

edantec commented Sep 19, 2024

Following the implementation of dynamic cast for components and residuals, Aligator should manage the templated cast of abstract classes for CostStack, all Integrators and all Dynamics. We should have a function getCostStack() in TrajOptProblem, getIntegrator() in integrator abstract class, and getDynamics() in dynamics abstract class.

@ManifoldFR
Copy link
Member

Instead of just a shortcut for getting a CostStack from the StageModel, we can do the same as in the previous PR, i.e.

// in StageModelTpl

template<typename U> U* getCost() { return dynamic_cast<U*>(&*this->cost_); }

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

No branches or pull requests

2 participants