With my simulations, I keep running into errors which only occur at runtime, such as
terminate called after throwing an instance of 'std::logic_error'
what(): Vector appears to be nearly zero.
and
abort: Failure at multibody/plant/implicit_stribeck_solver.cc:216 in SolveQuadraticForTheSmallestPositiveRoot(): condition 'Delta > 0' failed.
I'd like to be able to log the time in which these problems occur to track down the specific state which causes these errors. I'd also like to be able to log different state parameters such as forces and positions of my different bodies, which I know how to do.
Functions for checking body positions and states at different times have been documented, such as EvalPoseInWorld()
. What I'm looking for is some sort of failure trigger for outputting this data. I'd like to also be able to log the real_time_factor
visible in the drake simulator, but don't know how to access it.
For reference, I'm running an example I made in this fork: https://github.com/joaqgira/drake
You can run the example within drake/
with bazel run examples/springboard:shape_collision
.