From d0bdb78207468a3750065e6b7ba3bca90aea04a7 Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Tue, 17 Oct 2023 13:16:36 -0700 Subject: [PATCH] Disable island discovery for models with flexes. PiperOrigin-RevId: 574244981 Change-Id: I7c08b23cf5f29338a04ec684ad7a0d4d8a0397df --- doc/changelog.rst | 2 +- src/engine/engine_forward.c | 1 + src/engine/engine_island.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/changelog.rst b/doc/changelog.rst index 04edfb6d..d80ab46f 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -46,7 +46,7 @@ New features and degrees-of-freedom that do not interact. The only solver which currently supports islands is :ref:`CG`. Island discovery can be activated using a new :ref:`enable flag`. If island discovery is enabled, geoms, contacts and tendons will be colored according to the corresponding island, - see video. + see video. Island discovery is currently disabled for models that have deformable objects (see prevous item). 4. Added :ref:`mjThreadPool` and :ref:`mjTask` which allow for multi-threaded operations within the MuJoCo engine pipeline. If engine-internal threading is enabled, the following operations will be multi-threaded: diff --git a/src/engine/engine_forward.c b/src/engine/engine_forward.c index 98fa76ed..dd5fdd8b 100644 --- a/src/engine/engine_forward.c +++ b/src/engine/engine_forward.c @@ -619,6 +619,7 @@ void mj_fwdConstraint(const mjModel* m, mjData* d) { // check if islands are supported int islands_supported = mjENABLED(mjENBL_ISLAND) && + d->nisland > 0 && m->opt.solver == mjSOL_CG && m->opt.noslip_iterations == 0; diff --git a/src/engine/engine_island.c b/src/engine/engine_island.c index efa2edea..7a11735f 100644 --- a/src/engine/engine_island.c +++ b/src/engine/engine_island.c @@ -407,7 +407,7 @@ void mj_island(const mjModel* m, mjData* d) { int nv = m->nv, nefc = d->nefc, ntree=m->ntree; // no constraints: quick return - if (!nefc) { + if (!nefc || m->nflex) { // TODO: add flex support to island discovery d->nisland = 0; return; }