38 #define BOOST_TEST_MODULE FCL_SHAPE_MESH_CONSISTENCY 39 #include <boost/test/included/unit_test.hpp> 49 #define BOOST_CHECK_FALSE(p) BOOST_CHECK(!(p)) 86 for (std::size_t i = 0; i < 10; ++i) {
95 distance(&s1, pose1, &s2, pose2, request, res);
96 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
101 distance(&s1, pose1, &s2_rss, pose2, request, res1);
106 distance(&s1_rss, pose1, &s2, pose2, request, res1);
129 for (std::size_t i = 0; i < 10; ++i) {
138 distance(&s1, pose1, &s2, pose2, request, res);
139 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
144 distance(&s1, pose1, &s2_rss, pose2, request, res1);
149 distance(&s1_rss, pose1, &s2, pose2, request, res1);
189 for (std::size_t i = 0; i < 10; ++i) {
198 distance(&s1, pose1, &s2, pose2, request, res);
199 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
204 distance(&s1, pose1, &s2_rss, pose2, request, res1);
209 distance(&s1_rss, pose1, &s2, pose2, request, res1);
233 for (std::size_t i = 0; i < 10; ++i) {
242 distance(&s1, pose1, &s2, pose2, request, res);
243 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
248 distance(&s1, pose1, &s2_rss, pose2, request, res1);
253 distance(&s1_rss, pose1, &s2, pose2, request, res1);
293 for (std::size_t i = 0; i < 10; ++i) {
302 distance(&s1, pose1, &s2, pose2, request, res);
303 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
308 distance(&s1, pose1, &s2_rss, pose2, request, res1);
313 distance(&s1_rss, pose1, &s2, pose2, request, res1);
338 for (std::size_t i = 0; i < 10; ++i) {
347 distance(&s1, pose1, &s2, pose2, request, res);
348 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
353 distance(&s1, pose1, &s2_rss, pose2, request, res1);
358 distance(&s1_rss, pose1, &s2, pose2, request, res1);
397 for (std::size_t i = 0; i < 10; ++i) {
406 distance(&s1, pose1, &s2, pose2, request, res);
407 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
412 distance(&s1, pose1, &s2_rss, pose2, request, res1);
417 distance(&s1_rss, pose1, &s2, pose2, request, res1);
442 for (std::size_t i = 0; i < 10; ++i) {
451 distance(&s1, pose1, &s2, pose2, request, res);
452 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
457 distance(&s1, pose1, &s2_rss, pose2, request, res1);
462 distance(&s1_rss, pose1, &s2, pose2, request, res1);
501 for (std::size_t i = 0; i < 10; ++i) {
510 distance(&s1, pose1, &s2, pose2, request, res);
511 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
516 distance(&s1, pose1, &s2_rss, pose2, request, res1);
521 distance(&s1_rss, pose1, &s2, pose2, request, res1);
545 for (std::size_t i = 0; i < 10; ++i) {
554 distance(&s1, pose1, &s2, pose2, request, res);
555 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
560 distance(&s1, pose1, &s2_rss, pose2, request, res1);
565 distance(&s1_rss, pose1, &s2, pose2, request, res1);
605 for (std::size_t i = 0; i < 10; ++i) {
614 distance(&s1, pose1, &s2, pose2, request, res);
615 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
620 distance(&s1, pose1, &s2_rss, pose2, request, res1);
625 distance(&s1_rss, pose1, &s2, pose2, request, res1);
649 for (std::size_t i = 0; i < 10; ++i) {
658 distance(&s1, pose1, &s2, pose2, request, res);
659 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
664 distance(&s1, pose1, &s2_rss, pose2, request, res1);
669 distance(&s1_rss, pose1, &s2, pose2, request, res1);
709 for (std::size_t i = 0; i < 10; ++i) {
718 distance(&s1, pose1, &s2, pose2, request, res);
719 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
721 std::cout <<
"low resolution: " << res1.
min_distance <<
" " 728 distance(&s1, pose1, &s2_rss, pose2, request, res1);
730 std::cout <<
"low resolution: " << res1.
min_distance <<
" " 737 distance(&s1_rss, pose1, &s2, pose2, request, res1);
739 std::cout <<
"low resolution: " << res1.
min_distance <<
" " 765 for (std::size_t i = 0; i < 10; ++i) {
774 distance(&s1, pose1, &s2, pose2, request, res);
775 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
780 distance(&s1, pose1, &s2_rss, pose2, request, res1);
785 distance(&s1_rss, pose1, &s2, pose2, request, res1);
825 for (std::size_t i = 0; i < 10; ++i) {
834 distance(&s1, pose1, &s2, pose2, request, res);
835 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
840 distance(&s1, pose1, &s2_rss, pose2, request, res1);
845 distance(&s1_rss, pose1, &s2, pose2, request, res1);
869 for (std::size_t i = 0; i < 10; ++i) {
878 distance(&s1, pose1, &s2, pose2, request, res);
879 distance(&s1_rss, pose1, &s2_rss, pose2, request, res1);
884 distance(&s1, pose1, &s2_rss, pose2, request, res1);
889 distance(&s1_rss, pose1, &s2, pose2, request, res1);
1048 Vec3f(-29.8, 0, 0));
1050 Vec3f(-29.8, 0, 0));
1741 Vec3f(-29.8, 0, 0));
1743 Vec3f(-29.8, 0, 0));
request to the distance computation
Cylinder along Z axis. The cylinder is defined at its centroid.
void clear()
clear the result
request to the collision algorithm
void clear()
clear the results obtained
HPP_FCL_DLLAPI FCL_REAL distance(const Matrix3f &R0, const Vec3f &T0, const kIOS &b1, const kIOS &b2, Vec3f *P=NULL, Vec3f *Q=NULL)
Approximate distance between two kIOS bounding volumes.
#define BOOST_CHECK_FALSE(p)
BOOST_AUTO_TEST_CASE(consistency_distance_spheresphere)
FCL_REAL min_distance
minimum distance between two objects. if two objects are in collision, min_distance <= 0...
Center at zero point, axis aligned box.
A class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as ...
Cone The base of the cone is at and the top is at .
Center at zero point sphere.
HPP_FCL_DLLAPI std::size_t collide(const CollisionObject *o1, const CollisionObject *o2, const CollisionRequest &request, CollisionResult &result)
Main collision interface: given two collision objects, and the requirements for contacts, including num of max contacts, whether perform exhaustive collision (i.e., returning returning all the contact points), whether return detailed contact information (i.e., normal, contact point, depth; otherwise only contact primitive id is returned), this function performs the collision between them. Return value is the number of contacts generated between the two objects.
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
void generateBVHModel(BVHModel< BV > &model, const Box &shape, const Transform3f &pose)
Generate BVH model from box.
void generateRandomTransform(FCL_REAL extents[6], Transform3f &transform)
Generate one random transform whose translation is constrained by extents and rotation without constr...