You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While debugging @amcastro-tri and I stumbled across Drake's URDF parser silently ignoring an entry in a URDF; he suggested I post this as a GitHub issue. In the following code below, note the
<dynamics>
<damping>100</damping>
</dynamics>
section. This entry is silently ignored, however
<dynamicsdamping="100"/>
is correctly parsed. The difference is an XML attribute vs an XML element; are we deliberately silently ignoring all elements that are not recognized, or is this something we have not considered before?
It's worth noting that SDF and URDF fundamentally go in different directions. SDF prefers elements and URDF prefers attributes.
As documented for URDF, <dynamics damping="123"/> is the only correct form for URDF. Spelling it as a value is not equivalent and should not produce the same result. The nature of XML is to allow inclusion of arbitrary extra tags and to simply ignore them.
Short conclusion: <damping>100</damping> is 100% incorrect in a URDF file and should not contribute to a correctly configured joint. However, silently ignoring cruft (of any sort) in the URDF is unfortunate.
Looking at the URDF parsing code, it uses the strategy of looking for known elements and attributes, implicitly ignoring everything it isn't explicitly targeting. Short of validating the XML with a schema, this strategy precludes giving feedback on extraneous data.
I think it was worth noting this as a bug (since it gives us practical feedback), but probably we should resolve this as a duplicate of #16997. WDYT @rpoyner-tri?
What happened?
While debugging @amcastro-tri and I stumbled across Drake's URDF parser silently ignoring an entry in a URDF; he suggested I post this as a GitHub issue. In the following code below, note the
section. This entry is silently ignored, however
is correctly parsed. The difference is an XML attribute vs an XML element; are we deliberately silently ignoring all elements that are not recognized, or is this something we have not considered before?
Example Code
Version
af77662
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
The text was updated successfully, but these errors were encountered: