Delete remaining code related to now-removed distance equality constraint.
PiperOrigin-RevId: 513391064 Change-Id: I47fc344708a580c1e99bd2753113aaa408812966
This commit is contained in:
committed by
Copybara-Service
parent
50bebcb4ee
commit
fd1070cf03
@@ -71,11 +71,11 @@ struct mjContact_ { // result of collision detection functions
|
|||||||
int geom1; // id of geom 1
|
int geom1; // id of geom 1
|
||||||
int geom2; // id of geom 2
|
int geom2; // id of geom 2
|
||||||
|
|
||||||
// flag set by mj_fuseContact or mj_instantianteEquality
|
// flag set by mj_instantianteEquality
|
||||||
int exclude; // 0: include, 1: in gap, 2: fused, 3: equality, 4: no dofs
|
int exclude; // 0: include, 1: in gap, 2: fused, 3: no dofs
|
||||||
|
|
||||||
// address computed by mj_instantiateContact
|
// address computed by mj_instantiateContact
|
||||||
int efc_address; // address in efc; -1: not included, -2-i: distance constraint i
|
int efc_address; // address in efc; -1: not included
|
||||||
};
|
};
|
||||||
typedef struct mjContact_ mjContact;
|
typedef struct mjContact_ mjContact;
|
||||||
struct mjWarningStat_ { // warning statistics
|
struct mjWarningStat_ { // warning statistics
|
||||||
|
|||||||
@@ -84,11 +84,11 @@ struct mjContact_ { // result of collision detection functions
|
|||||||
int geom1; // id of geom 1
|
int geom1; // id of geom 1
|
||||||
int geom2; // id of geom 2
|
int geom2; // id of geom 2
|
||||||
|
|
||||||
// flag set by mj_fuseContact or mj_instantianteEquality
|
// flag set by mj_instantianteEquality
|
||||||
int exclude; // 0: include, 1: in gap, 2: fused, 3: equality, 4: no dofs
|
int exclude; // 0: include, 1: in gap, 2: fused, 3: no dofs
|
||||||
|
|
||||||
// address computed by mj_instantiateContact
|
// address computed by mj_instantiateContact
|
||||||
int efc_address; // address in efc; -1: not included, -2-i: distance constraint i
|
int efc_address; // address in efc; -1: not included
|
||||||
};
|
};
|
||||||
typedef struct mjContact_ mjContact;
|
typedef struct mjContact_ mjContact;
|
||||||
|
|
||||||
|
|||||||
@@ -540,10 +540,6 @@ void mj_instantiateEquality(const mjModel* m, mjData* d) {
|
|||||||
size = 1;
|
size = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case mjEQ_DISTANCE:
|
|
||||||
mju_error("distance equality constraints are no longer supported");
|
|
||||||
break;
|
|
||||||
|
|
||||||
default: // SHOULD NOT OCCUR
|
default: // SHOULD NOT OCCUR
|
||||||
mju_error_i("Invalid equality constraint type %d", m->eq_type[i]);
|
mju_error_i("Invalid equality constraint type %d", m->eq_type[i]);
|
||||||
}
|
}
|
||||||
@@ -806,7 +802,7 @@ void mj_instantiateContact(const mjModel* m, mjData* d) {
|
|||||||
// skip contact if no DOFs affected
|
// skip contact if no DOFs affected
|
||||||
if (NV==0) {
|
if (NV==0) {
|
||||||
con->efc_address = -1;
|
con->efc_address = -1;
|
||||||
con->exclude = 4;
|
con->exclude = 3;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -920,8 +916,8 @@ void mj_diagApprox(const mjModel* m, mjData* d) {
|
|||||||
m->tendon_invweight0[m->eq_obj2id[id]]);
|
m->tendon_invweight0[m->eq_obj2id[id]]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case mjEQ_DISTANCE:
|
default:
|
||||||
mju_error("distance equality constraints are no longer supported");
|
mju_error_i("Unknown constraint type type %d", d->efc_type[i]); // SHOULD NOT OCCUR
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -908,7 +908,7 @@ void mj_transmission(const mjModel* m, mjData* d) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// excluded contact, get sparse or dense Jacobian, accumulate
|
// excluded contact in gap: get sparse or dense Jacobian, accumulate
|
||||||
else if (con->exclude == 1) {
|
else if (con->exclude == 1) {
|
||||||
counter++;
|
counter++;
|
||||||
|
|
||||||
@@ -2034,10 +2034,6 @@ void mj_rnePostConstraint(const mjModel* m, mjData* d) {
|
|||||||
i++;
|
i++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case mjEQ_DISTANCE:
|
|
||||||
mju_error("distance equality constraints are no longer supported");
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
mju_error_i("Unknown constraint type type %d", m->eq_type[id]); // SHOULD NOT OCCUR
|
mju_error_i("Unknown constraint type type %d", m->eq_type[id]); // SHOULD NOT OCCUR
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -468,7 +468,6 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
|
|||||||
mjtNum *cur, *nxt, *xpos, *xfrc;
|
mjtNum *cur, *nxt, *xpos, *xfrc;
|
||||||
mjtNum vec[3], end[3], axis[3], rod, len, det, tmp[9], quat[4];
|
mjtNum vec[3], end[3], axis[3], rod, len, det, tmp[9], quat[4];
|
||||||
mjtByte broken;
|
mjtByte broken;
|
||||||
mjContact *con;
|
|
||||||
mjvGeom* thisgeom;
|
mjvGeom* thisgeom;
|
||||||
mjvPerturb localpert;
|
mjvPerturb localpert;
|
||||||
float scl = m->stat.meansize, rgba[4];
|
float scl = m->stat.meansize, rgba[4];
|
||||||
@@ -1667,39 +1666,6 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
|
|||||||
FINISH
|
FINISH
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// distance: find constraints at the end of the contact list
|
|
||||||
int j = d->ncon-1;
|
|
||||||
while (j>=0 && d->contact[j].exclude==3) {
|
|
||||||
// recover constraint id
|
|
||||||
int i = -d->contact[j].efc_address-2;
|
|
||||||
|
|
||||||
// segment = pos +/- normal*len
|
|
||||||
con = d->contact+j;
|
|
||||||
len = con->dist - m->eq_data[mjNEQDATA*i];
|
|
||||||
mju_addScl3(vec, con->pos, con->frame, 0.5*len);
|
|
||||||
mju_addScl3(end, con->pos, con->frame, -0.5*len);
|
|
||||||
|
|
||||||
// connect endpoints
|
|
||||||
START
|
|
||||||
|
|
||||||
// construct geom
|
|
||||||
sz[0] = scl * m->vis.scale.constraint;
|
|
||||||
mjv_makeConnector(thisgeom, mjGEOM_CAPSULE, sz[0],
|
|
||||||
vec[0], vec[1], vec[2],
|
|
||||||
end[0], end[1], end[2]);
|
|
||||||
|
|
||||||
f2f(thisgeom->rgba, m->vis.rgba.constraint, 4);
|
|
||||||
|
|
||||||
// vopt->label flag
|
|
||||||
if (vopt->label==mjLABEL_CONSTRAINT) {
|
|
||||||
makeLabel(m, mjOBJ_EQUALITY, i, thisgeom->label);
|
|
||||||
}
|
|
||||||
|
|
||||||
FINISH
|
|
||||||
|
|
||||||
j--;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// contact
|
// contact
|
||||||
|
|||||||
@@ -2957,8 +2957,6 @@ void mjCEquality::Compile(void) {
|
|||||||
objtype = mjOBJ_JOINT;
|
objtype = mjOBJ_JOINT;
|
||||||
} else if (type==mjEQ_TENDON) {
|
} else if (type==mjEQ_TENDON) {
|
||||||
objtype = mjOBJ_TENDON;
|
objtype = mjOBJ_TENDON;
|
||||||
} else if (type==mjEQ_DISTANCE) {
|
|
||||||
objtype = mjOBJ_GEOM;
|
|
||||||
} else {
|
} else {
|
||||||
throw mjCError(this, "invalid type in equality constraint '%s' (id = %d)'", name.c_str(), id);
|
throw mjCError(this, "invalid type in equality constraint '%s' (id = %d)'", name.c_str(), id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -483,11 +483,8 @@ void mjXWriter::OneEquality(XMLElement* elem, mjCEquality* peq, mjCDef* def) {
|
|||||||
WriteAttr(elem, "polycoef", 5, peq->data);
|
WriteAttr(elem, "polycoef", 5, peq->data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case mjEQ_DISTANCE:
|
default:
|
||||||
WriteAttrTxt(elem, "geom1", peq->name1);
|
mju_error("mjXWriter: unknown equality type.");
|
||||||
WriteAttrTxt(elem, "geom2", peq->name2);
|
|
||||||
WriteAttr(elem, "distance", 1, peq->data);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user