Add two new attributes to weld constraints:
- `anchor` determines the point of wrench application, in the frame of body2. - `tfratio` scales applied torques relative to applied forces. - Add visualisation of both anchor points to both weld and connect constraints. - Add a test model showing how the new weld parameters behave. PiperOrigin-RevId: 469228149 Change-Id: I836b0791f10fb624607a12ef3c687da991c21789
This commit is contained in:
committed by
Copybara-Service
parent
558aaf2923
commit
abc0a39b7a
@@ -234,8 +234,8 @@ static const char* MJCF[nMJCF][mjXATTRNUM] = {
|
||||
{"<"},
|
||||
{"connect", "*", "8", "name", "class", "body1", "body2", "anchor",
|
||||
"active", "solref", "solimp"},
|
||||
{"weld", "*", "10", "name", "class", "body1", "body2", "relpose", "anchor",
|
||||
"active", "solref", "solimp", "tfratio"},
|
||||
{"weld", "*", "8", "name", "class", "body1", "body2", "relpose",
|
||||
"active", "solref", "solimp"},
|
||||
{"joint", "*", "8", "name", "class", "joint1", "joint2", "polycoef",
|
||||
"active", "solref", "solimp"},
|
||||
{"tendon", "*", "8", "name", "class", "tendon1", "tendon2", "polycoef",
|
||||
@@ -1310,11 +1310,7 @@ void mjXReader::OneEquality(XMLElement* elem, mjCEquality* pequality) {
|
||||
case mjEQ_WELD:
|
||||
ReadAttrTxt(elem, "body1", pequality->name1, true);
|
||||
ReadAttrTxt(elem, "body2", pequality->name2);
|
||||
ReadAttr(elem, "relpose", 7, pequality->data+3, text);
|
||||
ReadAttr(elem, "tfratio", 1, pequality->data+10, text);
|
||||
if (!ReadAttr(elem, "anchor", 3, pequality->data, text)) {
|
||||
mjuu_zerovec(pequality->data, 3);
|
||||
}
|
||||
ReadAttr(elem, "relpose", mjNEQDATA, pequality->data, text);
|
||||
break;
|
||||
|
||||
case mjEQ_JOINT:
|
||||
|
||||
Reference in New Issue
Block a user