drake icon indicating copy to clipboard operation
drake copied to clipboard

[Mujoco parser] Don't call CalcSpatialInertia unless needed

Open RussTedrake opened this issue 1 year ago • 1 comments
trafficstars

Resolves #21648.

This defers the call to CalcSpatialInertia until/unless it is actually needed. If inertia values are specified for the body in the xml file, then we don't call CalcSpatialInertia. This allows us to successfully parse models where CalcSpatialInertia fails on the obj, but the calculation was not needed.

Adds the Rethink Robotics Sawyer (Apache 2.0) model to the detail_mujoco_parser_test; parsing fails on this model without the fix in this PR.

+@SeanCurtis-tri for feature review, please. (Rico is platform tomorrow). I will open a separate issue for the (seemingly very common) failures in CalcSpatialInertia from obj.


This change is Reviewable

RussTedrake avatar Jul 02 '24 02:07 RussTedrake