Disable hfields for collision sensors.

PiperOrigin-RevId: 685730321
Change-Id: Ib1d4a90b7b31ca388e018076a274e25c40409080
This commit is contained in:
Kyle Bayes
2024-10-14 09:18:14 -07:00
committed by Copybara-Service
parent ee7b994021
commit 8d84b5f693
4 changed files with 9 additions and 8 deletions
+6
View File
@@ -6399,6 +6399,12 @@ void mjCSensor::Compile(void) {
throw mjCError(this, "1st body/geom must be different from 2nd body/geom");
}
// height fields are not necessarily convex and are not yet supported
if (static_cast<mjCGeom*>(obj)->Type() == mjGEOM_HFIELD ||
static_cast<mjCGeom*>(ref)->Type() == mjGEOM_HFIELD) {
throw mjCError(this, "height fields are not supported in geom distance sensors");
}
// set
needstage = mjSTAGE_POS;
if (type==mjSENS_GEOMDIST) {