Save <compiler {boundmass/boundinertia}> if nonzero.

Fixes #928

PiperOrigin-RevId: 560967976
Change-Id: Idc8c043278362d8925ce41061c65f3e678ad50ce
This commit is contained in:
Yuval Tassa
2023-08-29 02:40:44 -07:00
committed by Copybara-Service
parent 8ba3291365
commit 55173e58f9
2 changed files with 34 additions and 0 deletions
+6
View File
@@ -768,6 +768,12 @@ void mjXWriter::Compiler(XMLElement* root) {
if (model->exactmeshinertia) {
WriteAttrTxt(section, "exactmeshinertia", "true");
}
if (model->boundmass) {
WriteAttr(section, "boundmass", 1, &model->boundmass);
}
if (model->boundinertia) {
WriteAttr(section, "boundinertia", 1, &model->boundinertia);
}
// always enable autolimits. limited attributes will be written appropriately
// TODO(b/245077553): Remove this when the default is true.
WriteAttrTxt(section, "autolimits", "true");