Add sphere-ellipsoid, sphere-cylinder. #2126

PiperOrigin-RevId: 683747371
Change-Id: Ic11803bb395944380d25ce848d9fbcf19afaad77
This commit is contained in:
Baruch Tabanpour
2024-10-08 13:35:52 -07:00
committed by Copybara-Service
parent 8256546432
commit fa22e6d001
5 changed files with 69 additions and 17 deletions
+15
View File
@@ -196,6 +196,21 @@ def _optim(
return dist, pos, math.make_frame(n)
@collider(ncon=1)
def sphere_ellipsoid(s: GeomInfo, e: GeomInfo) -> Collision:
""""Calculates contact between a sphere and an ellipsoid."""
x0 = 0.5 * (s.pos + e.pos)
return _optim(_sphere, _ellipsoid, s, e, x0)
@collider(ncon=1)
def sphere_cylinder(s: GeomInfo, c: GeomInfo) -> Collision:
""""Calculates contact between a sphere and a cylinder."""
# TODO: implement analytical version.
x0 = 0.5 * (s.pos + c.pos)
return _optim(_sphere, _cylinder, s, c, x0)
@collider(ncon=1)
def capsule_ellipsoid(c: GeomInfo, e: GeomInfo) -> Collision:
""""Calculates contact between a capsule and an ellipsoid."""