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

Introduce the Variables Handler #50

Merged
merged 5 commits into from
Jun 16, 2020
Merged

Conversation

GiulioRomualdi
Copy link
Member

This PR implement the first version of the variables handler. It is really useful for giving a meaning of variables stacked in a vector

Copy link
Collaborator

@traversaro traversaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments.

Co-authored-by: Silvio Traversaro <silvio.traversaro@iit.it>
class VariablesHandler
{

std::unordered_map<std::string, iDynTree::IndexRange> m_variables; /**< Map containing the name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are using an IndexRange, I guess that the assumption is to store all the values in a vector. Does it make sense to add a container to store the values in this class? In this way, once you fill the whole buffer (maybe from the solution of the optimization variable), you can get the values directly using getVariable, maybe using a GenericVector as a output. In fact, you can use span to get a reference to a sub-vector, then you can use it to build a GenericVector.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a short Fm2mF (Face-mask to mask-face) discussion we decided to avoid implementing this in the current PR. Since we are thinking to introduce CasADi in our pipeline, we may need different implementations of the handler.

@GiulioRomualdi GiulioRomualdi merged commit 1ff85f8 into master Jun 16, 2020
@GiulioRomualdi GiulioRomualdi deleted the feature/add_variable_handler branch June 16, 2020 15:45
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

Successfully merging this pull request may close these issues.

3 participants