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

Go to the source code of this file.

Namespaces

 coal
 Main namespace.
 

Macros

#define BOOST_CHECK_FALSE(p)   BOOST_CHECK(!(p))
 
#define BOOST_TEST_MODULE   COAL_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 (collide_boxbox)
 
 BOOST_AUTO_TEST_CASE (collide_conecone)
 
 BOOST_AUTO_TEST_CASE (collide_conecylinder)
 
 BOOST_AUTO_TEST_CASE (collide_cylindercylinder)
 
 BOOST_AUTO_TEST_CASE (collide_halfspacebox)
 
 BOOST_AUTO_TEST_CASE (collide_halfspacecapsule)
 
 BOOST_AUTO_TEST_CASE (collide_halfspacecone)
 
 BOOST_AUTO_TEST_CASE (collide_halfspacecylinder)
 
 BOOST_AUTO_TEST_CASE (collide_halfspacehalfspace)
 
 BOOST_AUTO_TEST_CASE (collide_halfspaceplane)
 
 BOOST_AUTO_TEST_CASE (collide_halfspacesphere)
 
 BOOST_AUTO_TEST_CASE (collide_halfspacetriangle)
 
 BOOST_AUTO_TEST_CASE (collide_planebox)
 
 BOOST_AUTO_TEST_CASE (collide_planecapsule)
 
 BOOST_AUTO_TEST_CASE (collide_planecone)
 
 BOOST_AUTO_TEST_CASE (collide_planecylinder)
 
 BOOST_AUTO_TEST_CASE (collide_planeplane)
 
 BOOST_AUTO_TEST_CASE (collide_planesphere)
 
 BOOST_AUTO_TEST_CASE (collide_planetriangle)
 
 BOOST_AUTO_TEST_CASE (collide_spherebox)
 
 BOOST_AUTO_TEST_CASE (collide_spherecapsule)
 
 BOOST_AUTO_TEST_CASE (collide_spheresphere)
 
 BOOST_AUTO_TEST_CASE (collide_spheretriangle)
 
 BOOST_AUTO_TEST_CASE (cone_to_bvh)
 
 BOOST_AUTO_TEST_CASE (cylinder_to_bvh)
 
 BOOST_AUTO_TEST_CASE (distance_spherebox)
 
 BOOST_AUTO_TEST_CASE (GJKSolver_shapeDistance_boxbox)
 
 BOOST_AUTO_TEST_CASE (GJKSolver_shapeDistance_boxsphere)
 
 BOOST_AUTO_TEST_CASE (GJKSolver_shapeDistance_conecone)
 
 BOOST_AUTO_TEST_CASE (GJKSolver_shapeDistance_conecylinder)
 
 BOOST_AUTO_TEST_CASE (GJKSolver_shapeDistance_cylinderbox)
 
 BOOST_AUTO_TEST_CASE (GJKSolver_shapeDistance_cylindercylinder)
 
 BOOST_AUTO_TEST_CASE (GJKSolver_shapeDistance_spheresphere)
 
 BOOST_AUTO_TEST_CASE (reversibleShapeDistance_allshapes)
 
 BOOST_AUTO_TEST_CASE (sphere_to_bvh)
 
template<typename S1 , typename S2 >
void compareContact (const S1 &s1, const Transform3s &tf1, const S2 &s2, const Transform3s &tf2, const Vec3s &contact, Vec3s *expected_point, CoalScalar depth, CoalScalar *expected_depth, const Vec3s &normal, Vec3s *expected_normal, bool check_opposite_normal, CoalScalar tol)
 
bool compareContactPoints (const Vec3s &c1, const Vec3s &c2)
 
std::ostream & coal::operator<< (std::ostream &os, const Box &b)
 
std::ostream & coal::operator<< (std::ostream &os, const ShapeBase &)
 
template<typename S1 , typename S2 >
void printComparisonError (const std::string &comparison_type, const S1 &s1, const Transform3s &tf1, const S2 &s2, const Transform3s &tf2, CoalScalar depth, CoalScalar expected_depth, CoalScalar tol)
 
template<typename S1 , typename S2 >
void printComparisonError (const std::string &comparison_type, const S1 &s1, const Transform3s &tf1, const S2 &s2, const Transform3s &tf2, const Vec3s &contact_or_normal, const Vec3s &expected_contact_or_normal, bool check_opposite_normal, CoalScalar tol)
 
void testBoxBoxContactPoints (const Matrix3s &R)
 
template<typename S1 , typename S2 >
void testReversibleShapeDistance (const S1 &s1, const S2 &s2, CoalScalar distance)
 
template<typename S1 , typename S2 >
void testShapeCollide (const S1 &s1, const Transform3s &tf1, const S2 &s2, const Transform3s &tf2, bool expect_collision, Vec3s *expected_point=NULL, CoalScalar *expected_depth=NULL, Vec3s *expected_normal=NULL, bool check_opposite_normal=false, CoalScalar tol=1e-9)
 

Variables

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

Macro Definition Documentation

◆ BOOST_CHECK_FALSE

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

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

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   COAL_GEOMETRIC_SHAPES
Author
Jia Pan

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

◆ FCL_CHECK

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

Definition at line 61 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 63 of file test/geometric_shapes.cpp.

◆ SET_LINE

#define SET_LINE   line = __LINE__

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

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/36]

BOOST_AUTO_TEST_CASE ( box_to_bvh  )

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

◆ BOOST_AUTO_TEST_CASE() [2/36]

BOOST_AUTO_TEST_CASE ( collide_boxbox  )

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

◆ BOOST_AUTO_TEST_CASE() [3/36]

BOOST_AUTO_TEST_CASE ( collide_conecone  )

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

◆ BOOST_AUTO_TEST_CASE() [4/36]

BOOST_AUTO_TEST_CASE ( collide_conecylinder  )

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

◆ BOOST_AUTO_TEST_CASE() [5/36]

BOOST_AUTO_TEST_CASE ( collide_cylindercylinder  )

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

◆ BOOST_AUTO_TEST_CASE() [6/36]

BOOST_AUTO_TEST_CASE ( collide_halfspacebox  )

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

◆ BOOST_AUTO_TEST_CASE() [7/36]

BOOST_AUTO_TEST_CASE ( collide_halfspacecapsule  )

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

◆ BOOST_AUTO_TEST_CASE() [8/36]

BOOST_AUTO_TEST_CASE ( collide_halfspacecone  )

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

◆ BOOST_AUTO_TEST_CASE() [9/36]

BOOST_AUTO_TEST_CASE ( collide_halfspacecylinder  )

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

◆ BOOST_AUTO_TEST_CASE() [10/36]

BOOST_AUTO_TEST_CASE ( collide_halfspacehalfspace  )

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

◆ BOOST_AUTO_TEST_CASE() [11/36]

BOOST_AUTO_TEST_CASE ( collide_halfspaceplane  )

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

◆ BOOST_AUTO_TEST_CASE() [12/36]

BOOST_AUTO_TEST_CASE ( collide_halfspacesphere  )

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

◆ BOOST_AUTO_TEST_CASE() [13/36]

BOOST_AUTO_TEST_CASE ( collide_halfspacetriangle  )

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

◆ BOOST_AUTO_TEST_CASE() [14/36]

BOOST_AUTO_TEST_CASE ( collide_planebox  )

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

◆ BOOST_AUTO_TEST_CASE() [15/36]

BOOST_AUTO_TEST_CASE ( collide_planecapsule  )

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

◆ BOOST_AUTO_TEST_CASE() [16/36]

BOOST_AUTO_TEST_CASE ( collide_planecone  )

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

◆ BOOST_AUTO_TEST_CASE() [17/36]

BOOST_AUTO_TEST_CASE ( collide_planecylinder  )

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

◆ BOOST_AUTO_TEST_CASE() [18/36]

BOOST_AUTO_TEST_CASE ( collide_planeplane  )

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

◆ BOOST_AUTO_TEST_CASE() [19/36]

BOOST_AUTO_TEST_CASE ( collide_planesphere  )

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

◆ BOOST_AUTO_TEST_CASE() [20/36]

BOOST_AUTO_TEST_CASE ( collide_planetriangle  )

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

◆ BOOST_AUTO_TEST_CASE() [21/36]

BOOST_AUTO_TEST_CASE ( collide_spherebox  )

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

◆ BOOST_AUTO_TEST_CASE() [22/36]

BOOST_AUTO_TEST_CASE ( collide_spherecapsule  )

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

◆ BOOST_AUTO_TEST_CASE() [23/36]

BOOST_AUTO_TEST_CASE ( collide_spheresphere  )

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

◆ BOOST_AUTO_TEST_CASE() [24/36]

BOOST_AUTO_TEST_CASE ( collide_spheretriangle  )

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

◆ BOOST_AUTO_TEST_CASE() [25/36]

BOOST_AUTO_TEST_CASE ( cone_to_bvh  )

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

◆ BOOST_AUTO_TEST_CASE() [26/36]

BOOST_AUTO_TEST_CASE ( cylinder_to_bvh  )

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

◆ BOOST_AUTO_TEST_CASE() [27/36]

BOOST_AUTO_TEST_CASE ( distance_spherebox  )

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

◆ BOOST_AUTO_TEST_CASE() [28/36]

BOOST_AUTO_TEST_CASE ( GJKSolver_shapeDistance_boxbox  )

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

◆ BOOST_AUTO_TEST_CASE() [29/36]

BOOST_AUTO_TEST_CASE ( GJKSolver_shapeDistance_boxsphere  )

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

◆ BOOST_AUTO_TEST_CASE() [30/36]

BOOST_AUTO_TEST_CASE ( GJKSolver_shapeDistance_conecone  )

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

◆ BOOST_AUTO_TEST_CASE() [31/36]

BOOST_AUTO_TEST_CASE ( GJKSolver_shapeDistance_conecylinder  )

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

◆ BOOST_AUTO_TEST_CASE() [32/36]

BOOST_AUTO_TEST_CASE ( GJKSolver_shapeDistance_cylinderbox  )

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

◆ BOOST_AUTO_TEST_CASE() [33/36]

BOOST_AUTO_TEST_CASE ( GJKSolver_shapeDistance_cylindercylinder  )

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

◆ BOOST_AUTO_TEST_CASE() [34/36]

BOOST_AUTO_TEST_CASE ( GJKSolver_shapeDistance_spheresphere  )

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

◆ BOOST_AUTO_TEST_CASE() [35/36]

BOOST_AUTO_TEST_CASE ( reversibleShapeDistance_allshapes  )

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

◆ BOOST_AUTO_TEST_CASE() [36/36]

BOOST_AUTO_TEST_CASE ( sphere_to_bvh  )

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

◆ compareContact()

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

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

◆ compareContactPoints()

bool compareContactPoints ( const Vec3s c1,
const Vec3s c2 
)

Definition at line 334 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 Transform3s tf1,
const S2 &  s2,
const Transform3s tf2,
CoalScalar  depth,
CoalScalar  expected_depth,
CoalScalar  tol 
)

Definition at line 111 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 Transform3s tf1,
const S2 &  s2,
const Transform3s tf2,
const Vec3s contact_or_normal,
const Vec3s expected_contact_or_normal,
bool  check_opposite_normal,
CoalScalar  tol 
)

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

◆ testBoxBoxContactPoints()

void testBoxBoxContactPoints ( const Matrix3s R)

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

◆ testReversibleShapeDistance()

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

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

◆ testShapeCollide()

template<typename S1 , typename S2 >
void testShapeCollide ( const S1 &  s1,
const Transform3s tf1,
const S2 &  s2,
const Transform3s tf2,
bool  expect_collision,
Vec3s expected_point = NULL,
CoalScalar expected_depth = NULL,
Vec3s expected_normal = NULL,
bool  check_opposite_normal = false,
CoalScalar  tol = 1e-9 
)

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

Variable Documentation

◆ extents

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

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

◆ line

int line

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

◆ solver1

GJKSolver solver1

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

◆ solver2

GJKSolver solver2

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

◆ tol_gjk

CoalScalar tol_gjk = 0.01

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

generate_distance_plot.b
float b
Definition: generate_distance_plot.py:7
line
int line
Definition: test/geometric_shapes.cpp:59


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:59