DAIRLab / dairlib

MIT License
75 stars 27 forks source link

Redudant contact constriants in OSC #137

Closed yminchen closed 2 years ago

yminchen commented 4 years ago

This issue was brought up in #95.

Currently the contact constraints are 3D per point in OperationalSpaceControl. This leads to potential redundant constraints. For example, the contact constraints for Cassie's foot should be 5 DoF because the foot can rotate along the line through the two contact points.

Not sure how much this affect the performance of OSC. We will need to test it and if it helps we will merge the new code into master branch.

yminchen commented 4 years ago

Issue resolved in PR #162

yminchen commented 4 years ago

PR #162 only fixed the issue partially. Currently the redundant constraint direction is expressed in the world frame, but we would like to express it in local frame such as the toe frame to avoid singularity.

Per discussion with @mposa , one quick solution could be using the local frame for the third frame in the arguments of the following functions. https://github.com/DAIRLab/dairlib/blob/9268cc75bac085a0829e18c9efe24400a997b5c4/multibody/kinematic/world_point_evaluator.cc#L68 https://github.com/DAIRLab/dairlib/blob/9268cc75bac085a0829e18c9efe24400a997b5c4/multibody/kinematic/world_point_evaluator.cc#L80

yminchen commented 2 years ago

PR #162 only fixed the issue partially. Currently the redundant constraint direction is expressed in the world frame, but we would like to express it in local frame such as the toe frame to avoid singularity.

Per discussion with @mposa , one quick solution could be using the local frame for the third frame in the arguments of the following functions.

https://github.com/DAIRLab/dairlib/blob/9268cc75bac085a0829e18c9efe24400a997b5c4/multibody/kinematic/world_point_evaluator.cc#L68

https://github.com/DAIRLab/dairlib/blob/9268cc75bac085a0829e18c9efe24400a997b5c4/multibody/kinematic/world_point_evaluator.cc#L80

Simply changing the third frame to toe frame didn't work, because we express the contact force wrt the frame in OSC which means the z axis has to point to world's +z.

267 rotates J and JdotV about global z axis (expressing J and JdotV in local frame).