nimblephysics
nimblephysics copied to clipboard
Friction basis is non-differentiable when normal is Unit Z
The method ContactConstraint::getTangentBasisMatrixODE(Eigen::Vector3d normal) produces the pair of vectors that, when combined with the vector normal, form an orthonormal basis of R^3. These two vectors become our two frictional directions.
This method experiences a discontinuity when normal == (0,0,1), and very large gradients near that point. This is obnoxious, and we'd like to rewrite it to avoid that. This is not mathematically possible in the general case: https://scicomp.stackexchange.com/a/27843. However, I'm sure we can somehow make our frictional basis "path dependent", and in so doing avoid the non-differentiable points by moving it to an unlikely spot given this timestep's collision information. This will require some thought.