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
+3 -3
View File
@@ -20,6 +20,7 @@
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <string>
#include <string_view>
@@ -2551,9 +2552,8 @@ void mjCModel::FuseStatic(void) {
}
// compute principal axes of inertia
mjCAlternative alt;
mjuu_copyvec(alt.fullinertia, toti, 6);
const char* err1 = alt.Set(par->iquat, par->inertia, degree, euler);
mjuu_copyvec(par->fullinertia, toti, 6);
const char* err1 = par->FullInertia(par->iquat, par->inertia);
if (err1) {
throw mjCError(NULL, "error '%s' in fusing static body inertias", err1);
}