diff --git a/doc/changelog.rst b/doc/changelog.rst index d4ac43d9..f957ab35 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -43,6 +43,11 @@ Python bindings 7. Fixed `#870 `__ where calling ``update_scene`` with an invalid camera name used the default camera. +Bug fixes +^^^^^^^^^ + +#. Fixed a bug that was causing the geom margins to be ignored during the midphase. + Version 2.3.7 (July 20, 2023) ----------------------------- diff --git a/src/engine/engine_collision_driver.c b/src/engine/engine_collision_driver.c index 23ad7c73..27182277 100644 --- a/src/engine/engine_collision_driver.c +++ b/src/engine/engine_collision_driver.c @@ -244,7 +244,8 @@ void mj_collideTree(const mjModel* m, mjData* d, int b1, int b2, // both are leaves if (isleaf1 && isleaf2 && nodeid1 != -1 && nodeid2 != -1) { - if (mj_collideSphere(m, d, nodeid1, nodeid2, /*margin=*/ 0)) { + if (mj_collideSphere(m, d, nodeid1, nodeid2, m->geom_margin[nodeid1] + + m->geom_margin[nodeid2])) { if (mj_collideOBB(m->geom_aabb + 6*nodeid1, m->geom_aabb + 6*nodeid2, d->geom_xpos + 3*nodeid1, d->geom_xmat + 9*nodeid1, d->geom_xpos + 3*nodeid2, d->geom_xmat + 9*nodeid2,