@@ -296,34 +296,18 @@ void test_distance_cylinder_box() {
296
296
box_size, X_WB);
297
297
}
298
298
299
- // This is a *specific* case that has cropped up in the wild that reaches the
300
- // unexpected `validateNearestFeatureOfPolytopeBeingEdge` error. This error was
301
- // reported in https://github.com/flexible-collision-library/fcl/issues/388
302
299
template <typename S>
303
- void test_distance_box_box1 () {
300
+ void test_distance_box_box_helper (const Vector3<S>& box1_size,
301
+ const Transform3<S>& X_WB1,
302
+ const Vector3<S>& box2_size,
303
+ const Transform3<S>& X_WB2) {
304
304
using CollisionGeometryPtr_t = std::shared_ptr<fcl::CollisionGeometryd>;
305
- const Vector3<S> box1_size (0.03 , 0.12 , 0.1 );
306
305
CollisionGeometryPtr_t box1_geo (
307
306
new fcl::Box<S>(box1_size (0 ), box1_size (1 ), box1_size (2 )));
308
- Transform3<S> X_WB1 = Transform3<S>::Identity ();
309
- X_WB1.matrix () << -3.0627937852578681533e-08 , -0.99999999999999888978 ,
310
- -2.8893865161583314238e-08 , 0.63499979627350811029 , 0.9999999999999980016 ,
311
- -3.0627939739957803544e-08 , 6.4729926918527511769e-08 ,
312
- -0.48500002215636439651 , -6.4729927722963847085e-08 ,
313
- -2.8893863029448751323e-08 , 0.99999999999999711342 , 1.0778146458339641356 ,
314
- 0 , 0 , 0 , 1 ;
315
307
fcl::CollisionObject<S> box1 (box1_geo, X_WB1);
316
308
317
- const Vector3<S> box2_size (0.025 , 0.35 , 1.845 );
318
309
CollisionGeometryPtr_t box2_geo (
319
310
new fcl::Box<S>(box2_size (0 ), box2_size (1 ), box2_size (2 )));
320
- Transform3<S> X_WB2 = Transform3<S>::Identity ();
321
- // clang-format off
322
- X_WB2.matrix () << 0 , -1 , 0 , 0.8 ,
323
- 1 , 0 , 0 , -0.4575 ,
324
- 0 , 0 , 1 , 1.0225 ,
325
- 0 , 0 , 0 , 1 ;
326
- // clang-format on
327
311
fcl::CollisionObject<S> box2 (box2_geo, X_WB2);
328
312
329
313
fcl::DistanceRequest<S> request;
@@ -347,6 +331,54 @@ void test_distance_box_box1() {
347
331
EXPECT_TRUE ((p_B2P2.array ().abs () <= (box2_size / 2 ).array () + tol).all ());
348
332
}
349
333
334
+ // This is a *specific* case that has cropped up in the wild that reaches the
335
+ // unexpected `validateNearestFeatureOfPolytopeBeingEdge` error. This error was
336
+ // reported in https://github.com/flexible-collision-library/fcl/issues/388
337
+ template <typename S>
338
+ void test_distance_box_box1 () {
339
+ const Vector3<S> box1_size (0.03 , 0.12 , 0.1 );
340
+ Transform3<S> X_WB1 = Transform3<S>::Identity ();
341
+ X_WB1.matrix () << -3.0627937852578681533e-08 , -0.99999999999999888978 ,
342
+ -2.8893865161583314238e-08 , 0.63499979627350811029 , 0.9999999999999980016 ,
343
+ -3.0627939739957803544e-08 , 6.4729926918527511769e-08 ,
344
+ -0.48500002215636439651 , -6.4729927722963847085e-08 ,
345
+ -2.8893863029448751323e-08 , 0.99999999999999711342 , 1.0778146458339641356 ,
346
+ 0 , 0 , 0 , 1 ;
347
+
348
+ const Vector3<S> box2_size (0.025 , 0.35 , 1.845 );
349
+ Transform3<S> X_WB2 = Transform3<S>::Identity ();
350
+ // clang-format off
351
+ X_WB2.matrix () << 0 , -1 , 0 , 0.8 ,
352
+ 1 , 0 , 0 , -0.4575 ,
353
+ 0 , 0 , 1 , 1.0225 ,
354
+ 0 , 0 , 0 , 1 ;
355
+ // clang-format on
356
+ test_distance_box_box_helper (box1_size, X_WB1, box2_size, X_WB2);
357
+ }
358
+
359
+ // This is a *specific* case that has cropped up in the wild that reaches the
360
+ // unexpected `triangle_size_is_zero` error. This error was
361
+ // reported in https://github.com/flexible-collision-library/fcl/issues/395
362
+ template <typename S>
363
+ void test_distance_box_box2 () {
364
+ const Vector3<S> box1_size (0.46 , 0.48 , 0.01 );
365
+ Transform3<S> X_WB1 = Transform3<S>::Identity ();
366
+ X_WB1.matrix () << 1 ,0 ,0 , -0.72099999999999997424 ,
367
+ 0 ,1 ,0 , -0.77200000000000001954 ,
368
+ 0 ,0 ,1 , 0.81000000000000005329 ,
369
+ 0 ,0 ,0 ,1 ;
370
+
371
+ const Vector3<S> box2_size (0.049521 , 0.146 , 0.0725 );
372
+ Transform3<S> X_WB2 = Transform3<S>::Identity ();
373
+ // clang-format off
374
+ X_WB2.matrix () << 0.10758262492983036718 , -0.6624881850015212903 , -0.74130653817877356637 , -0.42677133002999478872 ,
375
+ 0.22682184885125472595 , -0.709614040775253474 , 0.6670830248314786326 , -0.76596851247746788882 ,
376
+ -0.96797615037608542021 , -0.23991106241273435495 , 0.07392465377049164954 , 0.80746731400091054098 ,
377
+ 0 , 0 , 0 , 1 ;
378
+ // clang-format on
379
+ test_distance_box_box_helper (box1_size, X_WB1, box2_size, X_WB2);
380
+ }
381
+
350
382
// ==============================================================================
351
383
352
384
GTEST_TEST (FCL_NEGATIVE_DISTANCE, sphere_sphere_ccd)
@@ -380,6 +412,7 @@ GTEST_TEST(FCL_SIGNED_DISTANCE, cylinder_box_ccd) {
380
412
381
413
GTEST_TEST (FCL_SIGNED_DISTANCE, box_box1_ccd) {
382
414
test_distance_box_box1<double >();
415
+ test_distance_box_box2<double >();
383
416
}
384
417
385
418
// ==============================================================================
0 commit comments