Check obj and ref types before casting them to a geom.
PiperOrigin-RevId: 686616350 Change-Id: I43b14344df6324b371c6bb2447c63197b88178d5
This commit is contained in:
committed by
Copybara-Service
parent
c2024ef6d1
commit
8740533644
@@ -6402,8 +6402,8 @@ void mjCSensor::Compile(void) {
|
||||
}
|
||||
|
||||
// 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) {
|
||||
if ((objtype == mjOBJ_GEOM && static_cast<mjCGeom*>(obj)->Type() == mjGEOM_HFIELD) ||
|
||||
(reftype == mjOBJ_GEOM && static_cast<mjCGeom*>(ref)->Type() == mjGEOM_HFIELD)) {
|
||||
throw mjCError(this, "height fields are not supported in geom distance sensors");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user