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

Implement GlobalCoPEvaluator in contact Component #745

Merged
merged 15 commits into from
Oct 30, 2023
Merged

Conversation

GiulioRomualdi
Copy link
Member

@GiulioRomualdi GiulioRomualdi commented Oct 25, 2023

This PR implements the GlobalZMPEvaluator class that can be used to compute the local and global ZMP given a set of contacts.

The class implements the same checks already in place in the walking-controller class. Such as:

  • check for constant ZMP for a given amount of samples
  • outlier rejection in the ZMP evaluation

I implemented also the associated python bindings

⚠️ I was not able to find a better name for the class so if you find something feel free to suggest it :)

@S-Dafarra
Copy link
Member

Nitpick: the definition of the ZMP is slightly different, as it considers the acceleration of the CoM for example: see Eq. 21 of [1]. I think it would be more appropriate to use the CoP notation instead. The code of

zmp(0) = -wrench.torque()(1) / wrench.force()(2);
zmp(1) = wrench.torque()(0) / wrench.force()(2);
zmp(2) = 0.0;
corresponds to the definition of the CoP in case of planar ground. See Eq. (13) of [1]

[1]: Forces acting on a biped robot. Center of pressure-zero moment point

@GiulioRomualdi
Copy link
Member Author

After discussing with @S-Dafarra we decided to use the term XoP instead of ZMP.

Still, one thing should be decided. Is GlobalCoPEvaluator the proper name or we can find something better?

@S-Dafarra
Copy link
Member

Still, one thing should be decided. Is GlobalCoPEvaluator the proper name or we can find something better?

Maybe one thing to consider is to specify somewhere that by "global" we mean a weighted average, which may not follow the definition of "CoP"

@GiulioRomualdi
Copy link
Member Author

Yes I'm going to explain this in the class documentation

@GiulioRomualdi GiulioRomualdi force-pushed the evaluate_zmp branch 2 times, most recently from 7d87719 to 6156fee Compare October 30, 2023 11:29
@GiulioRomualdi GiulioRomualdi changed the title Implement GlobalZMPEvaluator in contact Component Implement GlobalCoPEvaluator in contact Component Oct 30, 2023
@GiulioRomualdi
Copy link
Member Author

Hi @S-Dafarra, I renamed the method from ZMP to CoP, let me know what you think :)

Copy link
Member

@S-Dafarra S-Dafarra 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

src/Math/include/BipedalLocomotion/Math/Wrench.h Outdated Show resolved Hide resolved
src/Contacts/src/GlobalCoPEvaluator.cpp Show resolved Hide resolved
* Following P. Sardain and G. Bessonnet, "Forces acting on a biped robot. Center of
* pressure-zero moment point," in IEEE Transactions on Systems, Man, and Cybernetics,
* we defined the global CoP as the weighted average of the CoP of each contact, with the weight
* determined by the normal force of the contact.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you point to the formula used? I could not found the proposed formula in the paper.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @traversaro it should be the following equation.

image

Still I can add the equation in the documentation

Copy link
Collaborator

Choose a reason for hiding this comment

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

But that is not the " weighted average of the CoP of each contact", right? This is the COP of the sum of the contact forces, and it can be proven that the two definitions are the same, with the assumptions that all the contacts occur in the same plane. So (nitpick) I would write "Consistently with", not "Following".

Copy link
Member Author

Choose a reason for hiding this comment

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

Here I wrote the math 881e92d

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.

Copy link
Member

@S-Dafarra S-Dafarra left a comment

Choose a reason for hiding this comment

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

A small comment on the doc. Feel free to proceed

@GiulioRomualdi
Copy link
Member Author

There was an uninitialized variable in GlobalCoPEvaluator::advance I fixed it in ba45836

@GiulioRomualdi GiulioRomualdi merged commit c4ec6d6 into master Oct 30, 2023
15 checks passed
@GiulioRomualdi GiulioRomualdi deleted the evaluate_zmp branch October 30, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants