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

[mc_control] Properly apply contact DoF when using the deprecated method #253

Merged
merged 4 commits into from
May 9, 2022

Conversation

arntanguy
Copy link
Collaborator

@arntanguy arntanguy commented Apr 29, 2022

Following #250, we noticed that the old method of setting contact DoF is no longer working.
For example:

  Eigen::Matrix6d dof = Eigen::Matrix6d::Identity(6, 6);
  dof(0, 0) = 0;
  dof(1, 1) = 0;
  dof(5, 5) = 0;
  // dof = Eigen::Matrix6d::Zero(6,6);
  tasks::qp::ContactId ContactId_R;
  tasks::qp::ContactId ContactId_L;
  ContactId_R = mc_rbdyn::Contact(robots(), 0, 1, "RightFoot", "AllGround").contactId(robots());
  ContactId_L = mc_rbdyn::Contact(robots(), 0, 1, "LeftFoot", "AllGround").contactId(robots());
  contactConstraint.contactConstr->addDofContact(ContactId_L, dof);
  contactConstraint.contactConstr->addDofContact(ContactId_R, dof);
  contactConstraint.contactConstr->updateDofContacts();
  solver().setContacts({{robots(), 0, 1, "LeftFoot", "AllGround"}, {robots(), 0, 1, "RightFoot", "AllGround"}});

results in two contacts set with full dof (1 1 1 1 1 1) instead of (0 0 1 1 1 0). This is because the Contact::from_mc_rbdyn doesn't take into account the contact's dof set in the constraint.

As a side note, tutorials haven't been updated and suggest using deprecated APIs:

Requires jrl-umi3218/Tasks#80

@gergondet
Copy link
Member

Nice catch!

I will update the tutorials in the PR (the second one even mentions the MoveContactTask which has been removed a few versions ago) then merge

@gergondet
Copy link
Member

Sorry for the long delay.

I have also moved the new base functionalities in the Python bindings and updated the tutorials to avoid usage of setContacts.

Will merge when the CI lands

@gergondet gergondet merged commit e1f0b74 into jrl-umi3218:master May 9, 2022
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.

2 participants