nimblephysics
nimblephysics copied to clipboard
Atlas Trajectory Bugs
This is all around unittests/comprehensive/test_AtlasTrajectory.cpp:
We'd like to have Atlas train a trajectory without tripping our World::setSlowDebugResultsAgainstFD(true) flag (see Finding and fixing bugs in the wiki). Currently, it crashes quite quickly.
To hunt for new bugs, use the TEST(ATLAS, FULL_TEST) test towards the bottom the file. That attempts to train a trajectory involving Atlas for 500 iterations, and then display the resulting trajectory in a web GUI.
Currently, the full test crashes after less than 1 iteration of training. I've copied the replication instructions from that failure out in TEST(ATLAS, BROKEN_2). The root cause appears to be that the Jacobian of the vector b that feeds into our LCP(A,b) solver is slightly wrong. As context, the b vector that goes into the LCP solver is a vector of the relative velocities at each of the contact points before the LCP solve (see the wiki for more details). I'm not sure why this Jacobian is wrong in this case, and it's not wrong by much, but the Jacobian needs to be broken down into its sub-components and tested to figure out where the error is creeping in. You can use BackpropSnapshot::scratch() to help explore which pieces of b are introducing our errors.
Once whatever it is is fixed, it's back to TEST(ATLAS, FULL_TEST) to mine for more bugs, until Atlas passes with a clean bill of health :)
TEST(ATLAS, BROKEN_2) fixed in a15fa9addc63deaa459b78b7991b74928bf6c6a6
Bug was due to BackpropSnapshot::getCoriolisAndGravityAndExternalForces() returning mid-step forces instead of pre-step, changed to world->getCoriolisAndGravityAndExternalForces() in BackpropSnapshot::getJacobianOfLCPOffsetClampingSubset()