jrl-umi3218 / lipm_walking_controller

Walking controller based on linear inverted pendulum tracking
BSD 2-Clause "Simplified" License
18 stars 11 forks source link

updating contact Refvel #37

Open Saeed-Mansouri opened 3 years ago

Saeed-Mansouri commented 3 years ago

Hello @stephane-caron

As far as I understood the contact.velRef is not updated in FootstepPlan::updateInitialTransform function. So I think that this is a bug of the LIPM. I like to suggest adding the following commands to the mentioned function.

for(auto & contact : contacts_)
  {
    contact.refVel = (X_delta.rotation()).inverse() * contact.refVel;
  }
stephane-caron commented 3 years ago

Good catch! :fishing_pole_and_fish:

This velocity is only set in PlanInterpolator::runWalking_() and it should indeed be updated by FootstepPlan::updateInitialTransform(), otherwise ModelPredictiveControl::updateVelCost() uses the velocity in the wrong frame.

I agree with your fix. Here is how it checks for me: