Move fullinertia from mjCAlternative to mjCBody with correction to handle URDF with 0 inertias.

PiperOrigin-RevId: 604812870
Change-Id: I018254d1362a654a4f99bf5e621d5abc7129a0c6
This commit is contained in:
Matthew Bennice
2024-02-06 17:20:24 -08:00
committed by Copybara-Service
parent 19c41aa965
commit b9c50ad79c
10 changed files with 96 additions and 72 deletions
+5 -1
View File
@@ -3021,7 +3021,11 @@ void mjXReader::Body(XMLElement* section, mjCBody* pbody, mjCFrame* frame) {
ReadQuat(elem, "quat", pbody->iquat, text);
ReadAttr(elem, "mass", 1, &pbody->mass, text, true);
ReadAttr(elem, "diaginertia", 3, pbody->inertia, text);
ReadAlternative(elem, pbody->ialt);
bool alt = ReadAlternative(elem, pbody->ialt);
bool full = ReadAttr(elem, "fullinertia", 6, pbody->fullinertia, text);
if (alt && full) {
throw mjXError(elem, "multiple orientation specifiers are not allowed");
}
}
// joint sub-element