Add per-body gravity compensation (buoyancy) passive force.
PiperOrigin-RevId: 485342531 Change-Id: Icb3e6bb5080b6ef17a3d3b1cc67e0503cfeaeffb
This commit is contained in:
committed by
Copybara-Service
parent
c7960385be
commit
23092a11d7
@@ -227,8 +227,8 @@ static const char* MJCF[nMJCF][mjXATTRNUM] = {
|
||||
"emission", "specular", "shininess", "reflectance", "rgba"},
|
||||
{">"},
|
||||
|
||||
{"body", "R", "10", "name", "childclass", "pos", "quat", "mocap",
|
||||
"axisangle", "xyaxes", "zaxis", "euler", "user"},
|
||||
{"body", "R", "11", "name", "childclass", "pos", "quat", "mocap",
|
||||
"axisangle", "xyaxes", "zaxis", "euler", "gravcomp", "user"},
|
||||
{"<"},
|
||||
{"plugin", "*", "3", "name", "plugin", "instance"},
|
||||
{"<"},
|
||||
@@ -2714,6 +2714,9 @@ void mjXReader::Body(XMLElement* section, mjCBody* pbody) {
|
||||
}
|
||||
ReadAlternative(elem, pchild->alt);
|
||||
|
||||
// read gravcomp
|
||||
ReadAttr(elem, "gravcomp", 1, &pchild->gravcomp, text);
|
||||
|
||||
// read userdata
|
||||
ReadVector(elem, "user", pchild->userdata, text);
|
||||
|
||||
|
||||
@@ -1338,6 +1338,9 @@ void mjXWriter::Body(XMLElement* elem, mjCBody* body) {
|
||||
WriteAttrKey(elem, "mocap", bool_map, 2, 1);
|
||||
}
|
||||
|
||||
// gravity compensation
|
||||
WriteAttr(elem, "gravcomp", 1, &body->gravcomp);
|
||||
|
||||
// userdata
|
||||
WriteVector(elem, "user", body->userdata);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user