Namespaces | Macros | Functions | Variables
test/geometric_shapes.cpp File Reference
#include <boost/test/included/unit_test.hpp>
#include <hpp/fcl/narrowphase/narrowphase.h>
#include <hpp/fcl/collision.h>
#include <hpp/fcl/distance.h>
#include "utility.h"
#include <iostream>
#include <hpp/fcl/internal/tools.h>
#include <hpp/fcl/shape/geometric_shape_to_BVH_model.h>
Include dependency graph for test/geometric_shapes.cpp:

Go to the source code of this file.

Namespaces

 hpp
 Main namespace.
 
 hpp::fcl
 

Macros

#define BOOST_CHECK_FALSE(p)   BOOST_CHECK(!(p))
 
#define BOOST_TEST_MODULE   FCL_GEOMETRIC_SHAPES
 
#define FCL_CHECK(cond)   BOOST_CHECK_MESSAGE(cond, "from line " << line << ": " #cond)
 
#define FCL_CHECK_EQUAL(a, b)
 
#define SET_LINE   line = __LINE__
 

Functions

 BOOST_AUTO_TEST_CASE (box_to_bvh)
 
 BOOST_AUTO_TEST_CASE (sphere_to_bvh)
 
 BOOST_AUTO_TEST_CASE (cylinder_to_bvh)
 
 BOOST_AUTO_TEST_CASE (cone_to_bvh)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_cylinderbox)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_spheresphere)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_boxbox)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_spherebox)
 
 BOOST_AUTO_TEST_CASE (shapeDistance_spherebox)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_spherecapsule)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_cylindercylinder)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_spheretriangle)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_halfspacetriangle)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_planetriangle)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_halfspacesphere)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_planesphere)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_halfspacebox)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_planebox)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_halfspacecapsule)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_planecapsule)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_halfspacecylinder)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_planecylinder)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_halfspacecone)
 
 BOOST_AUTO_TEST_CASE (shapeIntersection_planecone)
 
 BOOST_AUTO_TEST_CASE (shapeDistance_spheresphere)
 
 BOOST_AUTO_TEST_CASE (shapeDistance_boxbox)
 
 BOOST_AUTO_TEST_CASE (shapeDistance_boxsphere)
 
 BOOST_AUTO_TEST_CASE (shapeDistance_cylindercylinder)
 
 BOOST_AUTO_TEST_CASE (shapeDistance_conecone)
 
 BOOST_AUTO_TEST_CASE (shapeDistance_conecylinder)
 
 BOOST_AUTO_TEST_CASE (shapeIntersectionGJK_spheresphere)
 
 BOOST_AUTO_TEST_CASE (shapeIntersectionGJK_boxbox)
 
 BOOST_AUTO_TEST_CASE (shapeIntersectionGJK_spherebox)
 
 BOOST_AUTO_TEST_CASE (shapeIntersectionGJK_spherecapsule)
 
 BOOST_AUTO_TEST_CASE (shapeIntersectionGJK_cylindercylinder)
 
 BOOST_AUTO_TEST_CASE (shapeIntersectionGJK_conecone)
 
 BOOST_AUTO_TEST_CASE (shapeIntersectionGJK_conecylinder)
 
 BOOST_AUTO_TEST_CASE (shapeIntersectionGJK_spheretriangle)
 
 BOOST_AUTO_TEST_CASE (shapeIntersectionGJK_halfspacetriangle)
 
 BOOST_AUTO_TEST_CASE (shapeIntersectionGJK_planetriangle)
 
 BOOST_AUTO_TEST_CASE (spheresphere)
 
 BOOST_AUTO_TEST_CASE (boxbox)
 
 BOOST_AUTO_TEST_CASE (boxsphere)
 
 BOOST_AUTO_TEST_CASE (cylindercylinder)
 
 BOOST_AUTO_TEST_CASE (conecone)
 
 BOOST_AUTO_TEST_CASE (reversibleShapeDistance_allshapes)
 
template<typename S1 , typename S2 >
void compareContact (const S1 &s1, const Transform3f &tf1, const S2 &s2, const Transform3f &tf2, const Vec3f &contact, Vec3f *expected_point, FCL_REAL depth, FCL_REAL *expected_depth, const Vec3f &normal, Vec3f *expected_normal, bool check_opposite_normal, FCL_REAL tol)
 
bool compareContactPoints (const Vec3f &c1, const Vec3f &c2)
 
std::ostream & hpp::fcl::operator<< (std::ostream &os, const ShapeBase &)
 
std::ostream & hpp::fcl::operator<< (std::ostream &os, const Box &b)
 
template<typename S1 , typename S2 >
void printComparisonError (const std::string &comparison_type, const S1 &s1, const Transform3f &tf1, const S2 &s2, const Transform3f &tf2, const Vec3f &contact_or_normal, const Vec3f &expected_contact_or_normal, bool check_opposite_normal, FCL_REAL tol)
 
template<typename S1 , typename S2 >
void printComparisonError (const std::string &comparison_type, const S1 &s1, const Transform3f &tf1, const S2 &s2, const Transform3f &tf2, FCL_REAL depth, FCL_REAL expected_depth, FCL_REAL tol)
 
void testBoxBoxContactPoints (const Matrix3f &R)
 
template<typename S1 , typename S2 >
void testReversibleShapeDistance (const S1 &s1, const S2 &s2, FCL_REAL distance)
 
template<typename S1 , typename S2 >
void testShapeIntersection (const S1 &s1, const Transform3f &tf1, const S2 &s2, const Transform3f &tf2, bool expect_collision, Vec3f *expected_point=NULL, FCL_REAL *expected_depth=NULL, Vec3f *expected_normal=NULL, bool check_opposite_normal=false, FCL_REAL tol=1e-9)
 

Variables

FCL_REAL extents [6] = {0, 0, 0, 10, 10, 10}
 
int line
 
GJKSolver solver1
 
GJKSolver solver2
 
FCL_REAL tol_gjk = 0.01
 

Macro Definition Documentation

◆ BOOST_CHECK_FALSE

#define BOOST_CHECK_FALSE (   p)    BOOST_CHECK(!(p))

Definition at line 65 of file test/geometric_shapes.cpp.

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   FCL_GEOMETRIC_SHAPES
Author
Jia Pan

Definition at line 38 of file test/geometric_shapes.cpp.

◆ FCL_CHECK

#define FCL_CHECK (   cond)    BOOST_CHECK_MESSAGE(cond, "from line " << line << ": " #cond)

Definition at line 59 of file test/geometric_shapes.cpp.

◆ FCL_CHECK_EQUAL

#define FCL_CHECK_EQUAL (   a,
 
)
Value:
BOOST_CHECK_MESSAGE((a) == (b), "from line " << line << ": " #a "[" << (a) \
<< "] != " #b "[" << (b) \
<< "].")

Definition at line 61 of file test/geometric_shapes.cpp.

◆ SET_LINE

#define SET_LINE   line = __LINE__

Definition at line 58 of file test/geometric_shapes.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/46]

BOOST_AUTO_TEST_CASE ( box_to_bvh  )

Definition at line 210 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [2/46]

BOOST_AUTO_TEST_CASE ( sphere_to_bvh  )

Definition at line 216 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [3/46]

BOOST_AUTO_TEST_CASE ( cylinder_to_bvh  )

Definition at line 223 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [4/46]

BOOST_AUTO_TEST_CASE ( cone_to_bvh  )

Definition at line 230 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [5/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_cylinderbox  )

Definition at line 237 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [6/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_spheresphere  )

Definition at line 293 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [7/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_boxbox  )

Definition at line 439 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [8/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_spherebox  )

Definition at line 505 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [9/46]

BOOST_AUTO_TEST_CASE ( shapeDistance_spherebox  )

Definition at line 559 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [10/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_spherecapsule  )

Definition at line 582 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [11/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_cylindercylinder  )

Definition at line 647 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [12/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_spheretriangle  )

Definition at line 835 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [13/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_halfspacetriangle  )

Definition at line 882 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [14/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_planetriangle  )

Definition at line 938 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [15/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_halfspacesphere  )

Definition at line 982 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [16/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_planesphere  )

Definition at line 1071 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [17/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_halfspacebox  )

Definition at line 1154 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [18/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_planebox  )

Definition at line 1248 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [19/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_halfspacecapsule  )

Definition at line 1336 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [20/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_planecapsule  )

Definition at line 1577 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [21/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_halfspacecylinder  )

Definition at line 1800 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [22/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_planecylinder  )

Definition at line 2041 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [23/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_halfspacecone  )

Definition at line 2264 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [24/46]

BOOST_AUTO_TEST_CASE ( shapeIntersection_planecone  )

Definition at line 2505 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [25/46]

BOOST_AUTO_TEST_CASE ( shapeDistance_spheresphere  )

Definition at line 2729 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [26/46]

BOOST_AUTO_TEST_CASE ( shapeDistance_boxbox  )

Definition at line 2812 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [27/46]

BOOST_AUTO_TEST_CASE ( shapeDistance_boxsphere  )

Definition at line 2900 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [28/46]

BOOST_AUTO_TEST_CASE ( shapeDistance_cylindercylinder  )

Definition at line 2964 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [29/46]

BOOST_AUTO_TEST_CASE ( shapeDistance_conecone  )

Definition at line 3010 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [30/46]

BOOST_AUTO_TEST_CASE ( shapeDistance_conecylinder  )

Definition at line 3056 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [31/46]

BOOST_AUTO_TEST_CASE ( shapeIntersectionGJK_spheresphere  )

Definition at line 3102 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [32/46]

BOOST_AUTO_TEST_CASE ( shapeIntersectionGJK_boxbox  )

Definition at line 3199 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [33/46]

BOOST_AUTO_TEST_CASE ( shapeIntersectionGJK_spherebox  )

Definition at line 3257 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [34/46]

BOOST_AUTO_TEST_CASE ( shapeIntersectionGJK_spherecapsule  )

Definition at line 3315 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [35/46]

BOOST_AUTO_TEST_CASE ( shapeIntersectionGJK_cylindercylinder  )

Definition at line 3368 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [36/46]

BOOST_AUTO_TEST_CASE ( shapeIntersectionGJK_conecone  )

Definition at line 3425 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [37/46]

BOOST_AUTO_TEST_CASE ( shapeIntersectionGJK_conecylinder  )

Definition at line 3494 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [38/46]

BOOST_AUTO_TEST_CASE ( shapeIntersectionGJK_spheretriangle  )

Definition at line 3569 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [39/46]

BOOST_AUTO_TEST_CASE ( shapeIntersectionGJK_halfspacetriangle  )

Definition at line 3617 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [40/46]

BOOST_AUTO_TEST_CASE ( shapeIntersectionGJK_planetriangle  )

Definition at line 3665 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [41/46]

BOOST_AUTO_TEST_CASE ( spheresphere  )

Definition at line 3713 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [42/46]

BOOST_AUTO_TEST_CASE ( boxbox  )

Definition at line 3796 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [43/46]

BOOST_AUTO_TEST_CASE ( boxsphere  )

Definition at line 3842 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [44/46]

BOOST_AUTO_TEST_CASE ( cylindercylinder  )

Definition at line 3888 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [45/46]

BOOST_AUTO_TEST_CASE ( conecone  )

Definition at line 3934 of file test/geometric_shapes.cpp.

◆ BOOST_AUTO_TEST_CASE() [46/46]

BOOST_AUTO_TEST_CASE ( reversibleShapeDistance_allshapes  )

Definition at line 4019 of file test/geometric_shapes.cpp.

◆ compareContact()

template<typename S1 , typename S2 >
void compareContact ( const S1 &  s1,
const Transform3f tf1,
const S2 &  s2,
const Transform3f tf2,
const Vec3f contact,
Vec3f expected_point,
FCL_REAL  depth,
FCL_REAL expected_depth,
const Vec3f normal,
Vec3f expected_normal,
bool  check_opposite_normal,
FCL_REAL  tol 
)

Definition at line 129 of file test/geometric_shapes.cpp.

◆ compareContactPoints()

bool compareContactPoints ( const Vec3f c1,
const Vec3f c2 
)

Definition at line 390 of file test/geometric_shapes.cpp.

◆ printComparisonError() [1/2]

template<typename S1 , typename S2 >
void printComparisonError ( const std::string &  comparison_type,
const S1 &  s1,
const Transform3f tf1,
const S2 &  s2,
const Transform3f tf2,
const Vec3f contact_or_normal,
const Vec3f expected_contact_or_normal,
bool  check_opposite_normal,
FCL_REAL  tol 
)

Definition at line 80 of file test/geometric_shapes.cpp.

◆ printComparisonError() [2/2]

template<typename S1 , typename S2 >
void printComparisonError ( const std::string &  comparison_type,
const S1 &  s1,
const Transform3f tf1,
const S2 &  s2,
const Transform3f tf2,
FCL_REAL  depth,
FCL_REAL  expected_depth,
FCL_REAL  tol 
)

Definition at line 111 of file test/geometric_shapes.cpp.

◆ testBoxBoxContactPoints()

void testBoxBoxContactPoints ( const Matrix3f R)

Definition at line 394 of file test/geometric_shapes.cpp.

◆ testReversibleShapeDistance()

template<typename S1 , typename S2 >
void testReversibleShapeDistance ( const S1 &  s1,
const S2 &  s2,
FCL_REAL  distance 
)

Definition at line 3981 of file test/geometric_shapes.cpp.

◆ testShapeIntersection()

template<typename S1 , typename S2 >
void testShapeIntersection ( const S1 &  s1,
const Transform3f tf1,
const S2 &  s2,
const Transform3f tf2,
bool  expect_collision,
Vec3f expected_point = NULL,
FCL_REAL expected_depth = NULL,
Vec3f expected_normal = NULL,
bool  check_opposite_normal = false,
FCL_REAL  tol = 1e-9 
)

Definition at line 165 of file test/geometric_shapes.cpp.

Variable Documentation

◆ extents

FCL_REAL extents[6] = {0, 0, 0, 10, 10, 10}

Definition at line 51 of file test/geometric_shapes.cpp.

◆ line

int line

Definition at line 57 of file test/geometric_shapes.cpp.

◆ solver1

GJKSolver solver1

Definition at line 54 of file test/geometric_shapes.cpp.

◆ solver2

GJKSolver solver2

Definition at line 55 of file test/geometric_shapes.cpp.

◆ tol_gjk

FCL_REAL tol_gjk = 0.01

Definition at line 53 of file test/geometric_shapes.cpp.



hpp-fcl
Author(s):
autogenerated on Fri Jun 2 2023 02:39:02