Add insidesite sensor for detecting when an object is inside the volume of a site.
PiperOrigin-RevId: 780993257 Change-Id: I2dcfc840d222680adc3b934344a0819f4d78b6eb
This commit is contained in:
committed by
Copybara-Service
parent
a86461fc57
commit
e6c5715903
@@ -365,6 +365,15 @@ void mj_sensorPos(const mjModel* m, mjData* d) {
|
||||
mju_copy3(d->sensordata+adr, d->subtree_com+3*objid);
|
||||
break;
|
||||
|
||||
case mjSENS_INSIDESITE: // insidesite
|
||||
get_xpos_xmat(d, objtype, objid, i, &xpos, &xmat);
|
||||
d->sensordata[adr] = mju_insideGeom(d->site_xpos + 3*refid,
|
||||
d->site_xmat + 9*refid,
|
||||
m->site_size + 3*refid,
|
||||
m->site_type[refid],
|
||||
xpos);
|
||||
break;
|
||||
|
||||
case mjSENS_GEOMDIST: // signed distance between two geoms
|
||||
case mjSENS_GEOMNORMAL: // normal direction between two geoms
|
||||
case mjSENS_GEOMFROMTO: // segment between two geoms
|
||||
|
||||
Reference in New Issue
Block a user