RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.23k stars 1.25k forks source link

<mimic> tag in urdf is silently ignored; can lead to confusing TAMSI error messages with no justification #16181

Closed RussTedrake closed 2 years ago

RussTedrake commented 2 years ago

Problem: Someone grabs the default franka_description from the web, and puts it in Drake. The result is that TAMSI (reasonably) falls down, ironically at this line:

    // Geometry tell us that a real solution does exist i.e. Delta > 0.
    DRAKE_DEMAND(Delta > 0);

It doesn't exactly instill confidence, nor help someone see a path forward.

It turns out that the fingers in those models have no inertia, and are presumably relying on the mimic tag in the urdf http://wiki.ros.org/urdf/XML/joint, which we silently ignore. To be honest, I'm not sure what other simulators do, because it seems like there is no inertia on either finger!

Proposed resolution: The real solution to this is to support equality constraints in MultibodyPlant (e.g., #14694). In the short term, I think we should at least produce a helpful warning if we are ignoring a mimic tag?

sherm1 commented 2 years ago

cc @joemasterjohn @amcastro-tri constraints!

amcastro-tri commented 2 years ago

I think we should at least produce a helpful warning if we are ignoring a mimic tag?

I think that is the most reasonable thing to do. Probably we should have mechanism to give a warning for any of element that Drake ignores.

jwnimmer-tri commented 2 years ago

Probably we should have mechanism to give a warning for any of element that Drake ignores.

Filed as #16229 now.

jwnimmer-tri commented 2 years ago

Since #16229 has taken over the "diagnose unsupported elements during parsing" feature, should we re-purpose this issue to be about the poor error message Delta > 0 when a user forgets to add inertia to their links? That happens quite frequently for new users, even without the particular <mimic/> failure mode.

Ideally we'd report a more information error message.

amcastro-tri commented 2 years ago

should we re-purpose this issue to be about the poor error message Delta > 0 when a user forgets to add inertia to their links?

I believe no. The demand for Delta > 0 can be triggered due to many reasons. It only tells you there was a problem with the numerics somewhere, but it could be anywhere.

That is, IMO we should have explicit warnings at parsing when a user forgets to add inertia to their links. I'd imagine in the future if that link with no inertia was welded to another link in the model, we could assume the link is meant to have zero mass and the user meant it to be an "extension" of the link it is welded to. IMO that's a horrible semantics, all links should have inertia specified and I would even escalate those warnings to errors.

Thoughts?

jwnimmer-tri commented 2 years ago

That's exactly what I was trying to say -- when the user forgets to add inertia, we should fail-fast and tell them so, we should never give them the Delta > 0 error in that specific case. Other cases might still yell about Delta, just not the you-forgot-your-inertia case anymore.

jwnimmer-tri commented 2 years ago

Given the discussion history here, I suppose it would be clearest to file a new issue for that missing diagnostic for missing inertia.

jwnimmer-tri commented 2 years ago

I just now filed the "missing intertia" diagnostic (unrelated to the mimic tag) as #16992. The "ignored mimic tag" issue is a duplicate of #16783, or more broadly #16229. Therefore, I'll close this issue out in lieu of the two more-specific issues.