Use GJK to recover contact points for sphere and capsule geoms in nativeccd.
PiperOrigin-RevId: 704727907 Change-Id: Iff641b6a32637c48e9892dbaa60826617c54ed06
This commit is contained in:
committed by
Copybara-Service
parent
a7fed25fdd
commit
a364308d5a
@@ -56,6 +56,7 @@ def _collide(
|
||||
d = mujoco.MjData(m)
|
||||
dx = mjx.put_data(m, d)
|
||||
|
||||
m.opt.enableflags |= mujoco.mjtEnableBit.mjENBL_NATIVECCD
|
||||
mujoco.mj_step(m, d)
|
||||
collision_jit_fn = jax.jit(mjx.collision)
|
||||
kinematics_jit_fn = jax.jit(mjx.kinematics)
|
||||
@@ -241,7 +242,7 @@ class EllipsoidCollisionTest(parameterized.TestCase):
|
||||
self.assertLess(dx.contact.dist[0], 0)
|
||||
for field in dataclasses.fields(Contact):
|
||||
_assert_attr_eq(
|
||||
dx.contact, d.contact, field.name, 'ellipsoid-ellipsoid', 1e-5
|
||||
dx.contact, d.contact, field.name, 'ellipsoid-ellipsoid', 1e-2
|
||||
)
|
||||
|
||||
_ELLIPSOID_SPHERE = """
|
||||
@@ -265,7 +266,7 @@ class EllipsoidCollisionTest(parameterized.TestCase):
|
||||
self.assertLess(dx.contact.dist[0], 0)
|
||||
for field in dataclasses.fields(Contact):
|
||||
_assert_attr_eq(
|
||||
dx.contact, d.contact, field.name, 'ellipsoid-sphere', 1e-3
|
||||
dx.contact, d.contact, field.name, 'ellipsoid-sphere', 1e-4
|
||||
)
|
||||
|
||||
_ELLIPSOID_CAPSULE = """
|
||||
@@ -288,7 +289,7 @@ class EllipsoidCollisionTest(parameterized.TestCase):
|
||||
self.assertLess(dx.contact.dist[0], 0)
|
||||
for field in dataclasses.fields(Contact):
|
||||
_assert_attr_eq(
|
||||
dx.contact, d.contact, field.name, 'ellipsoid-capsule', 1e-3
|
||||
dx.contact, d.contact, field.name, 'ellipsoid-capsule', 1e-5
|
||||
)
|
||||
|
||||
_ELLIPSOID_CYLINDER = """
|
||||
|
||||
Reference in New Issue
Block a user