If <composite flatinertia="true">, set mjCBody.explicit_inertial so that an <inertial> element is added in mj_saveLastXML. Bug found by the WriteReadCompare test.

PiperOrigin-RevId: 450702639
Change-Id: I978dfb6713d68ce8327f2e8eea1fc31f43a38b5e
This commit is contained in:
Alessio Quaglino
2022-05-24 09:38:06 -07:00
committed by Copybara-Service
parent dbf6c74f8f
commit 43e3b3a3f9
4 changed files with 15 additions and 6 deletions
+4 -1
View File
@@ -160,6 +160,9 @@ class mjCBody : public mjCBase {
// setup child local frame, take into account change
void MakeLocal(double* locpos, double* locquat, const double* pos, const double* quat);
// set explicit_inertial to true
void MakeInertialExplicit();
// variables set by user or 'Compile'
bool mocap; // is this a mocap body
double pos[3]; // frame position
@@ -188,7 +191,7 @@ class mjCBody : public mjCBase {
int weldid; // top index of body we are welded to
int dofnum; // number of motion dofs for body
int mocapid; // mocap id, -1: not mocap
bool explicit_inertial; // whether inertial clause was explicitly stated
bool explicit_inertial; // whether to save the body with an explicit inertial clause
int lastdof; // id of last dof (used by compiler)