Add mjmBodyPair to C API.

PiperOrigin-RevId: 606997065
Change-Id: Iefc2dff6ae942ce93ca83ec5f5fe9d7ae8bb6a40
This commit is contained in:
Alessio Quaglino
2024-02-14 08:39:01 -08:00
committed by Copybara-Service
parent c9e7586499
commit 80a986c0f5
7 changed files with 95 additions and 31 deletions
+6 -6
View File
@@ -864,9 +864,9 @@ mjmBody* mjCComposite::AddCableBody(mjCModel* model, mjmBody* body, int ix, mjtN
// exclude contact pair
if (!last) {
mjCBodyPair* exclude = model->AddExclude();
exclude->bodyname1 = this_body;
exclude->bodyname2 = next_body;
mjmExclude* exclude = mjm_addExclude(model);
mjm_setString(exclude->bodyname1, std::string(this_body).c_str());
mjm_setString(exclude->bodyname2, std::string(next_body).c_str());
}
// add site at the boundary
@@ -939,9 +939,9 @@ bool mjCComposite::MakeRope(mjCModel* model, mjmBody* body, char* error, int err
mju_copy(eq->solimp, solimpsmooth, mjNIMP);
// remove contact between connected bodies
mjCBodyPair* pair = model->AddExclude();
pair->bodyname1 = txt;
pair->bodyname2 = txt2;
mjmExclude* pair = mjm_addExclude(model);
mjm_setString(pair->bodyname1, std::string(txt).c_str());
mjm_setString(pair->bodyname2, std::string(txt2).c_str());
}
return true;