@@ -265,6 +265,49 @@ def test_frame_collision():
265
265
assert np .allclose (fdata .Jx , fdata2 .Jx , atol = ATOL )
266
266
267
267
268
+ def test_FrameCollisionResidual_no_collision_pairs ():
269
+ import hppfcl
270
+
271
+ fr_name1 = "larm_shoulder2_body"
272
+ fr_id1 = model .getFrameId (fr_name1 )
273
+ joint_id = model .frames [fr_id1 ].parentJoint
274
+
275
+ fr_name2 = "rleg_elbow_body"
276
+ fr_id2 = model .getFrameId (fr_name2 )
277
+ joint_id2 = model .frames [fr_id2 ].parentJoint
278
+
279
+ frame_SE3 = pin .SE3 .Random ()
280
+ frame_SE3_bis = pin .SE3 .Random ()
281
+ alpha = np .random .rand ()
282
+ beta = np .random .rand ()
283
+ gamma = np .random .rand ()
284
+ delta = np .random .rand ()
285
+
286
+ geometry = pin .GeometryModel ()
287
+ ig_frame = geometry .addGeometryObject (
288
+ pin .GeometryObject (
289
+ "frame" , fr_id1 , joint_id , hppfcl .Capsule (alpha , gamma ), frame_SE3
290
+ )
291
+ )
292
+
293
+ ig_frame2 = geometry .addGeometryObject (
294
+ pin .GeometryObject (
295
+ "frame2" , fr_id2 , joint_id2 , hppfcl .Capsule (beta , delta ), frame_SE3_bis
296
+ )
297
+ )
298
+
299
+ space = manifolds .MultibodyConfiguration (model )
300
+ ndx = space .ndx
301
+ x0 = space .neutral ()
302
+ d = np .random .randn (space .ndx ) * 0.1
303
+ d [6 :] = 0.0
304
+ x0 = space .integrate (x0 , d )
305
+ u0 = np .zeros (nu )
306
+ q0 = x0 [:nq ]
307
+
308
+ fun = aligator .FrameCollisionResidual (ndx , nu , model , geometry , 0 )
309
+
310
+
268
311
if __name__ == "__main__" :
269
312
import sys
270
313
import pytest
0 commit comments