Do not create contact if there are no DOFs.

PiperOrigin-RevId: 601146599
Change-Id: I68b1975a3217b266bbbfb0a15c85a65cfa46facb
This commit is contained in:
Alessio Quaglino
2024-01-24 09:36:27 -08:00
committed by Copybara-Service
parent aede8cf5cf
commit c8e839a666
+1 -1
View File
@@ -908,7 +908,7 @@ void mj_instantiateContact(const mjModel* m, mjData* d) {
mjContact* con;
mjtNum cpos[6], cmargin[6], *jac, *jacdif, *jacdifp, *jacdifr, *jac1p, *jac2p, *jac1r, *jac2r;
if (mjDISABLED(mjDSBL_CONTACT) || ncon == 0) {
if (mjDISABLED(mjDSBL_CONTACT) || ncon == 0 || nv == 0) {
return;
}