Open RussTedrake opened 4 days ago
Deferring the CalcSpatialInertia call in the parser is a relatively straightforward fix. I've opened #21649 to pull in the failing models and provide test coverage for that fix. I can push that fix through. Then I'll open a follow-up (lower priority) issue on the failing call to CalcSpatialInertia.
What happened?
Looking more into the
IsPhysicallyValid()
errors reported in #20444, I think I've found the culprit.PR #19342 (by @rpoyner-tri and @SeanCurtis-TRI) introduced a change in detail_mujoco_parser.cc (now on this line), which I believe is too brittle.
Here is a minimal reproduction:
This fails by throwing
(notably, it does not actually say which body was at fault, which makes it frustrating to debug).
It turns out that the
ur5e.xml
specifies inertias for all of its bodies, so no inertia needs to be calculated from the geometry. But we still calculate the inertia from the mesh, and fail when doing so, and throw an undebuggable error message.I believe this is also the culprit for at least some number of the other models listed as failing with invalid inertias in #20444.
Ideally, we would defer calculation of the inertia until if/when it is needed. And ideally our CalcSpatialInertia method would not (ever?) fail the
IsPhysicallyValid()
test.cc @agarwal-abhinav
Version
No response
What operating system are you using?
Ubuntu 22.04
What installation option are you using?
compiled from source code using Bazel
Relevant log output
No response