-
Notifications
You must be signed in to change notification settings - Fork 5
Add getters for contact vector and state derivative #31
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
Conversation
mpc.solver | ||
.workspace.problem_data.stage_data[1] | ||
.dynamics_data.continuous_data.xdot[nv:] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh my god it was so long
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have a few comments
{ | ||
ExplicitIntegratorData * int_data = | ||
dynamic_cast<ExplicitIntegratorData *>(&*solver_->workspace_.problem_data.stage_data[t]->dynamics_data); | ||
return int_data->continuous_data->xdot_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please return ConstVectorRef
to get a numpy view array in Python (that you can explicitly copy). This avoids doing copies when not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add an assert()
or other runtime check that int_data
is not nullptr - which would be a cast error.
{ | ||
std::vector<bool> contact_state; | ||
CentroidalFwdDynamics * ode = | ||
problem_->stages_[t]->getDynamics<IntegratorEuler>()->getDynamics<CentroidalFwdDynamics>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here also add a runtime check that ode
is not nullptr.
No description provided.