Drake: py mbp: Getting hard exit from "Failure at external/drake/multibody/plant/tamsi_solver.cc:217 in SolveQuadraticForTheSmallestPositiveRoot(): condition 'Delta > 0' failed."?

Created on 28 Jan 2021  路  8Comments  路  Source: RobotLocomotion/drake

In some Python code in Anzu, I'm running MBP with some crazy neural network whatever visuomotor stuff, and at some point I get the following hard error, using 6ee5e9325821277a62bd5cd5456ccf02ca25dab7

Failure at external/drake/multibody/plant/tamsi_solver.cc:217 in SolveQuadraticForTheSmallestPositiveRoot(): condition 'Delta > 0' failed.

This should at least be an Exception in Python-land? (e.g. #5268).
I'm not sure if I can make a min-repro, but I'll at least see if I can convert this to a softer exception.

May re-assign if there's more nuance here.

FYI @amcastro-tri @sherm1

multibody plant python medium dynamics

All 8 comments

I should double-check that it's not just a SystemExit condition as well.

Those are rare. But usually are related to the solver already in the process of diverging. It does happen if the condition you are trying to solver for takes the solver to unstable land. Might also be a new bug, but that's the usual case.

Is there a way to catch that condition @amcastro-tri to produce a better error message?

Also experiencing this bug but I'm using a peg from September so it isn't newly introduced. Would not be surprised if it is the result of unstable sim.

Yeah, I think integrator explosions / instability probably wouldn't be surprising (this is testing a policy that comes from training on top of randomly initialized weights); the main crux of this issue is namely the user-unfriendly mode of killing the interpreter.

I've been hitting these occasionally too, usually when making model changes. It would be helpful if there were a debugging strategy (and/or a more helpful message). My current strategy is to give up and say "well, I guess I don't get to try that."

What I could do is to make TamsiSolver::SolveWithGuess() detect this condition and return something like TamsiSolverResult::kDivergence. This would then lead to printing the much nicer message here explaining not only what happened but also providing possible solutions.

Would that be an acceptable solution?

That would be awesome!!!

Was this page helpful?
0 / 5 - 0 ratings