Add XML compiler/saveinertial flag. Fixes #2405
PiperOrigin-RevId: 743607654 Change-Id: I1f2e61be89b79c1995e079f36aa285096f9fb441
This commit is contained in:
committed by
Copybara-Service
parent
8941f56e86
commit
f96f3e1c22
@@ -1632,7 +1632,8 @@ void mjXWriter::Body(XMLElement* elem, mjCBody* body, mjCFrame* frame, string_vi
|
||||
WriteVector(elem, "user", body->get_userdata());
|
||||
|
||||
// write inertial
|
||||
if (body->explicitinertial && model->compiler.inertiafromgeom != mjINERTIAFROMGEOM_TRUE) {
|
||||
if (model->compiler.saveinertial ||
|
||||
(body->explicitinertial && model->compiler.inertiafromgeom != mjINERTIAFROMGEOM_TRUE)) {
|
||||
XMLElement* inertial = InsertEnd(elem, "inertial");
|
||||
WriteAttr(inertial, "pos", 3, body->ipos);
|
||||
WriteAttr(inertial, "quat", 4, body->iquat, unitq);
|
||||
|
||||
Reference in New Issue
Block a user