Add mjModel.tendon_armature (in preparation, not yet implemented)

PiperOrigin-RevId: 743649968
Change-Id: I1d893e3e06afc48b652575bc7837750ab3573670
This commit is contained in:
Yuval Tassa
2025-04-03 12:05:30 -07:00
committed by Copybara-Service
parent f96f3e1c22
commit e1f5ceb65a
14 changed files with 140 additions and 11 deletions
+2
View File
@@ -3390,6 +3390,7 @@ void mjCModel::CopyObjects(mjModel* m) {
m->tendon_margin[i] = (mjtNum)pte->margin;
m->tendon_stiffness[i] = (mjtNum)pte->stiffness;
m->tendon_damping[i] = (mjtNum)pte->damping;
m->tendon_armature[i] = (mjtNum)pte->armature;
m->tendon_frictionloss[i] = (mjtNum)pte->frictionloss;
m->tendon_lengthspring[2*i] = (mjtNum)pte->springlength[0];
m->tendon_lengthspring[2*i+1] = (mjtNum)pte->springlength[1];
@@ -4931,6 +4932,7 @@ bool mjCModel::CopyBack(const mjModel* m) {
tendons_[i]->margin = (double)m->tendon_margin[i];
tendons_[i]->stiffness = (double)m->tendon_stiffness[i];
tendons_[i]->damping = (double)m->tendon_damping[i];
tendons_[i]->armature = (double)m->tendon_armature[i];
tendons_[i]->frictionloss = (double)m->tendon_frictionloss[i];
if (nuser_tendon) {
+12
View File
@@ -5616,6 +5616,12 @@ void mjCTendon::Compile(void) {
// spatial path
else {
if (armature < 0) {
throw mjCError(this,
"tendon '%s' (id = %d): tendon armature cannot be negative",
name.c_str(), id);
}
switch (path[i]->type) {
case mjWRAP_PULLEY:
// pulley should not follow other pulley
@@ -5657,6 +5663,12 @@ void mjCTendon::Compile(void) {
name.c_str(), id, i);
}
if (armature > 0) {
throw mjCError(this,
"tendon '%s' (id = %d): geom wrapping not supported by tendon armature",
name.c_str(), id);
}
// mark geoms as non visual
model->Geoms()[path[i]->obj->id]->SetNotVisual();
break;