From 6602e1bc1eb240953eed16fde1c7ba576ac42b76 Mon Sep 17 00:00:00 2001 From: Wolfgang Merkt Date: Wed, 26 Jun 2024 16:37:01 +0100 Subject: [PATCH 1/7] Fix Wpedantic --- .../internal/shape_shape_contact_patch_func.h | 12 ++--- include/hpp/fcl/internal/shape_shape_func.h | 52 +++++++++---------- src/narrowphase/support_functions.cpp | 20 +++---- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/include/hpp/fcl/internal/shape_shape_contact_patch_func.h b/include/hpp/fcl/internal/shape_shape_contact_patch_func.h index 33c5b9791..9e3f6ec01 100644 --- a/include/hpp/fcl/internal/shape_shape_contact_patch_func.h +++ b/include/hpp/fcl/internal/shape_shape_contact_patch_func.h @@ -201,8 +201,8 @@ void computePatchPlaneOrHalfspace(const OtherShapeType& s1, } \ }; -PLANE_OR_HSPACE_AND_OTHER_SHAPE_CONTACT_PATCH(Plane); -PLANE_OR_HSPACE_AND_OTHER_SHAPE_CONTACT_PATCH(Halfspace); +PLANE_OR_HSPACE_AND_OTHER_SHAPE_CONTACT_PATCH(Plane) +PLANE_OR_HSPACE_AND_OTHER_SHAPE_CONTACT_PATCH(Halfspace) #define PLANE_HSPACE_CONTACT_PATCH(PlaneOrHspace1, PlaneOrHspace2) \ template <> \ @@ -241,10 +241,10 @@ PLANE_OR_HSPACE_AND_OTHER_SHAPE_CONTACT_PATCH(Halfspace); } \ }; -PLANE_HSPACE_CONTACT_PATCH(Plane, Plane); -PLANE_HSPACE_CONTACT_PATCH(Plane, Halfspace); -PLANE_HSPACE_CONTACT_PATCH(Halfspace, Plane); -PLANE_HSPACE_CONTACT_PATCH(Halfspace, Halfspace); +PLANE_HSPACE_CONTACT_PATCH(Plane, Plane) +PLANE_HSPACE_CONTACT_PATCH(Plane, Halfspace) +PLANE_HSPACE_CONTACT_PATCH(Halfspace, Plane) +PLANE_HSPACE_CONTACT_PATCH(Halfspace, Halfspace) #undef PLANE_OR_HSPACE_AND_OTHER_SHAPE_CONTACT_PATCH #undef PLANE_HSPACE_CONTACT_PATCH diff --git a/include/hpp/fcl/internal/shape_shape_func.h b/include/hpp/fcl/internal/shape_shape_func.h index 43643712a..3321b4b38 100644 --- a/include/hpp/fcl/internal/shape_shape_func.h +++ b/include/hpp/fcl/internal/shape_shape_func.h @@ -278,32 +278,32 @@ std::size_t ShapeShapeCollide(const CollisionGeometry* o1, return result.min_distance; \ } -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Box, Halfspace); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Box, Plane); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Box, Sphere); -SHAPE_SELF_DISTANCE_SPECIALIZATION(Capsule); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Capsule, Halfspace); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Capsule, Plane); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Cone, Halfspace); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Cone, Plane); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Cylinder, Halfspace); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Cylinder, Plane); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Sphere, Halfspace); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Sphere, Plane); -SHAPE_SELF_DISTANCE_SPECIALIZATION(Sphere); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Sphere, Cylinder); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Sphere, Capsule); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Ellipsoid, Halfspace); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Ellipsoid, Plane); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(ConvexBase, Halfspace); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(ConvexBase, Plane); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(TriangleP, Halfspace); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(TriangleP, Plane); -SHAPE_SELF_DISTANCE_SPECIALIZATION(TriangleP); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(TriangleP, Sphere); -SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Plane, Halfspace); -SHAPE_SELF_DISTANCE_SPECIALIZATION(Plane); -SHAPE_SELF_DISTANCE_SPECIALIZATION(Halfspace); +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Box, Halfspace) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Box, Plane) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Box, Sphere) +SHAPE_SELF_DISTANCE_SPECIALIZATION(Capsule) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Capsule, Halfspace) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Capsule, Plane) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Cone, Halfspace) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Cone, Plane) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Cylinder, Halfspace) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Cylinder, Plane) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Sphere, Halfspace) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Sphere, Plane) +SHAPE_SELF_DISTANCE_SPECIALIZATION(Sphere) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Sphere, Cylinder) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Sphere, Capsule) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Ellipsoid, Halfspace) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Ellipsoid, Plane) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(ConvexBase, Halfspace) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(ConvexBase, Plane) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(TriangleP, Halfspace) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(TriangleP, Plane) +SHAPE_SELF_DISTANCE_SPECIALIZATION(TriangleP) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(TriangleP, Sphere) +SHAPE_SHAPE_DISTANCE_SPECIALIZATION(Plane, Halfspace) +SHAPE_SELF_DISTANCE_SPECIALIZATION(Plane) +SHAPE_SELF_DISTANCE_SPECIALIZATION(Halfspace) #undef SHAPE_SHAPE_DISTANCE_SPECIALIZATION #undef SHAPE_SELF_DISTANCE_SPECIALIZATION diff --git a/src/narrowphase/support_functions.cpp b/src/narrowphase/support_functions.cpp index c215654d9..e9d92cfa2 100644 --- a/src/narrowphase/support_functions.cpp +++ b/src/narrowphase/support_functions.cpp @@ -132,7 +132,7 @@ void getShapeSupport(const TriangleP* triangle, const Vec3f& dir, support += triangle->getSweptSphereRadius() * dir.normalized(); } } -getShapeSupportTplInstantiation(TriangleP); +getShapeSupportTplInstantiation(TriangleP) // ============================================================================ template @@ -152,7 +152,7 @@ inline void getShapeSupport(const Box* box, const Vec3f& dir, Vec3f& support, support += box->getSweptSphereRadius() * dir.normalized(); } } -getShapeSupportTplInstantiation(Box); +getShapeSupportTplInstantiation(Box) // ============================================================================ template @@ -169,7 +169,7 @@ inline void getShapeSupport(const Sphere* sphere, const Vec3f& dir, HPP_FCL_UNUSED_VARIABLE(sphere); HPP_FCL_UNUSED_VARIABLE(dir); } -getShapeSupportTplInstantiation(Sphere); +getShapeSupportTplInstantiation(Sphere) // ============================================================================ template @@ -190,7 +190,7 @@ inline void getShapeSupport(const Ellipsoid* ellipsoid, const Vec3f& dir, support += ellipsoid->getSweptSphereRadius() * dir.normalized(); } } -getShapeSupportTplInstantiation(Ellipsoid); +getShapeSupportTplInstantiation(Ellipsoid) // ============================================================================ template @@ -211,7 +211,7 @@ inline void getShapeSupport(const Capsule* capsule, const Vec3f& dir, (capsule->radius + capsule->getSweptSphereRadius()) * dir.normalized(); } } -getShapeSupportTplInstantiation(Capsule); +getShapeSupportTplInstantiation(Capsule) // ============================================================================ template @@ -261,7 +261,7 @@ void getShapeSupport(const Cone* cone, const Vec3f& dir, Vec3f& support, support += cone->getSweptSphereRadius() * dir.normalized(); } } -getShapeSupportTplInstantiation(Cone); +getShapeSupportTplInstantiation(Cone) // ============================================================================ template @@ -301,7 +301,7 @@ void getShapeSupport(const Cylinder* cylinder, const Vec3f& dir, Vec3f& support, support += cylinder->getSweptSphereRadius() * dir.normalized(); } } -getShapeSupportTplInstantiation(Cylinder); +getShapeSupportTplInstantiation(Cylinder) // ============================================================================ template @@ -419,7 +419,7 @@ void getShapeSupport(const ConvexBase* convex, const Vec3f& dir, Vec3f& support, support_data); } } -getShapeSupportTplInstantiation(ConvexBase); +getShapeSupportTplInstantiation(ConvexBase) // ============================================================================ template @@ -430,7 +430,7 @@ inline void getShapeSupport(const SmallConvex* convex, const Vec3f& dir, reinterpret_cast(convex), dir, support, hint, support_data); } -getShapeSupportTplInstantiation(SmallConvex); +getShapeSupportTplInstantiation(SmallConvex) // ============================================================================ template @@ -441,7 +441,7 @@ inline void getShapeSupport(const LargeConvex* convex, const Vec3f& dir, reinterpret_cast(convex), dir, support, hint, support_data); } -getShapeSupportTplInstantiation(LargeConvex); +getShapeSupportTplInstantiation(LargeConvex) // ============================================================================ #define CALL_GET_SHAPE_SUPPORT_SET(ShapeType) \ From b8ab18bbb3f6b65d3d6f0c9a3747bce9d0773b98 Mon Sep 17 00:00:00 2001 From: Wolfgang Merkt Date: Wed, 26 Jun 2024 16:37:09 +0100 Subject: [PATCH 2/7] Fix float conversion --- include/hpp/fcl/math/transform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hpp/fcl/math/transform.h b/include/hpp/fcl/math/transform.h index 34d3fcda0..9a1d31e5d 100644 --- a/include/hpp/fcl/math/transform.h +++ b/include/hpp/fcl/math/transform.h @@ -234,7 +234,7 @@ inline Quatf uniformRandomQuaternion() { const FCL_REAL mult1 = std::sqrt(FCL_REAL(1.0) - u1); const FCL_REAL mult2 = std::sqrt(u1); - static const FCL_REAL PI_value = EIGEN_PI; + static const FCL_REAL PI_value = static_cast(EIGEN_PI); FCL_REAL s2 = std::sin(2 * PI_value * u2); FCL_REAL c2 = std::cos(2 * PI_value * u2); FCL_REAL s3 = std::sin(2 * PI_value * u3); From 3dd03814dccb7f2ffcd2c994b536c913db134eb1 Mon Sep 17 00:00:00 2001 From: Wolfgang Merkt Date: Wed, 26 Jun 2024 17:27:12 +0100 Subject: [PATCH 3/7] Use clang-format off and on to avoid issue with fix for Wpedantic --- src/narrowphase/support_functions.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/narrowphase/support_functions.cpp b/src/narrowphase/support_functions.cpp index e9d92cfa2..898a002ea 100644 --- a/src/narrowphase/support_functions.cpp +++ b/src/narrowphase/support_functions.cpp @@ -132,7 +132,9 @@ void getShapeSupport(const TriangleP* triangle, const Vec3f& dir, support += triangle->getSweptSphereRadius() * dir.normalized(); } } +// clang-format off getShapeSupportTplInstantiation(TriangleP) +// clang-format on // ============================================================================ template @@ -152,7 +154,9 @@ inline void getShapeSupport(const Box* box, const Vec3f& dir, Vec3f& support, support += box->getSweptSphereRadius() * dir.normalized(); } } +// clang-format off getShapeSupportTplInstantiation(Box) +// clang-format on // ============================================================================ template @@ -169,7 +173,9 @@ inline void getShapeSupport(const Sphere* sphere, const Vec3f& dir, HPP_FCL_UNUSED_VARIABLE(sphere); HPP_FCL_UNUSED_VARIABLE(dir); } +// clang-format off getShapeSupportTplInstantiation(Sphere) +// clang-format on // ============================================================================ template @@ -190,7 +196,9 @@ inline void getShapeSupport(const Ellipsoid* ellipsoid, const Vec3f& dir, support += ellipsoid->getSweptSphereRadius() * dir.normalized(); } } +// clang-format off getShapeSupportTplInstantiation(Ellipsoid) +// clang-format on // ============================================================================ template @@ -211,7 +219,9 @@ inline void getShapeSupport(const Capsule* capsule, const Vec3f& dir, (capsule->radius + capsule->getSweptSphereRadius()) * dir.normalized(); } } +// clang-format off getShapeSupportTplInstantiation(Capsule) +// clang-format on // ============================================================================ template @@ -261,7 +271,9 @@ void getShapeSupport(const Cone* cone, const Vec3f& dir, Vec3f& support, support += cone->getSweptSphereRadius() * dir.normalized(); } } +// clang-format off getShapeSupportTplInstantiation(Cone) +// clang-format on // ============================================================================ template @@ -301,7 +313,9 @@ void getShapeSupport(const Cylinder* cylinder, const Vec3f& dir, Vec3f& support, support += cylinder->getSweptSphereRadius() * dir.normalized(); } } +// clang-format off getShapeSupportTplInstantiation(Cylinder) +// clang-format on // ============================================================================ template @@ -419,7 +433,9 @@ void getShapeSupport(const ConvexBase* convex, const Vec3f& dir, Vec3f& support, support_data); } } +// clang-format off getShapeSupportTplInstantiation(ConvexBase) +// clang-format on // ============================================================================ template @@ -430,7 +446,9 @@ inline void getShapeSupport(const SmallConvex* convex, const Vec3f& dir, reinterpret_cast(convex), dir, support, hint, support_data); } +// clang-format off getShapeSupportTplInstantiation(SmallConvex) +// clang-format on // ============================================================================ template @@ -441,7 +459,9 @@ inline void getShapeSupport(const LargeConvex* convex, const Vec3f& dir, reinterpret_cast(convex), dir, support, hint, support_data); } +// clang-format off getShapeSupportTplInstantiation(LargeConvex) +// clang-format on // ============================================================================ #define CALL_GET_SHAPE_SUPPORT_SET(ShapeType) \ From 84307fefc1a24ae67d9318ea4dc22a5d0abeefbb Mon Sep 17 00:00:00 2001 From: Wolfgang Merkt Date: Wed, 26 Jun 2024 17:27:20 +0100 Subject: [PATCH 4/7] Fix implicit conversion --- include/hpp/fcl/serialization/contact_patch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hpp/fcl/serialization/contact_patch.h b/include/hpp/fcl/serialization/contact_patch.h index 09a5cab4a..71d984ca9 100644 --- a/include/hpp/fcl/serialization/contact_patch.h +++ b/include/hpp/fcl/serialization/contact_patch.h @@ -26,7 +26,7 @@ void serialize(Archive& ar, hpp::fcl::ContactPatch& contact_patch, } Eigen::Map points_map( reinterpret_cast(contact_patch.points().data()), 2, - patch_size); + static_cast(patch_size)); ar& make_nvp("points", points_map); } From 90d625d09ffb7206f478e9ff2f4073dbd48123da Mon Sep 17 00:00:00 2001 From: Wolfgang Merkt Date: Wed, 26 Jun 2024 17:50:04 +0100 Subject: [PATCH 5/7] Ignore deprecated declarations in Python bindings --- python/broadphase/broadphase.cc | 6 ++++++ python/collision.cc | 9 +++++++++ python/distance.cc | 6 ++++++ 3 files changed, 21 insertions(+) diff --git a/python/broadphase/broadphase.cc b/python/broadphase/broadphase.cc index 9e5ee5243..f6f9592ae 100644 --- a/python/broadphase/broadphase.cc +++ b/python/broadphase/broadphase.cc @@ -44,8 +44,11 @@ #include "hpp/fcl/broadphase/broadphase_interval_tree.h" #include "hpp/fcl/broadphase/broadphase_spatialhash.h" +HPP_FCL_COMPILER_DIAGNOSTIC_PUSH +HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS #ifdef HPP_FCL_HAS_DOXYGEN_AUTODOC #include "doxygen_autodoc/functions.h" +HPP_FCL_COMPILER_DIAGNOSTIC_POP #include "doxygen_autodoc/hpp/fcl/broadphase/default_broadphase_callbacks.h" // #include "doxygen_autodoc/hpp/fcl/broadphase/broadphase_dynamic_AABB_tree.h" // #include @@ -62,6 +65,8 @@ using namespace hpp::fcl; +HPP_FCL_COMPILER_DIAGNOSTIC_PUSH +HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS void exposeBroadPhase() { CollisionCallBackBaseWrapper::expose(); DistanceCallBackBaseWrapper::expose(); @@ -134,3 +139,4 @@ void exposeBroadPhase() { bp::optional>()); } } +HPP_FCL_COMPILER_DIAGNOSTIC_POP diff --git a/python/collision.cc b/python/collision.cc index 5ea8550f5..db7d13dff 100644 --- a/python/collision.cc +++ b/python/collision.cc @@ -35,8 +35,11 @@ #include #include +HPP_FCL_COMPILER_DIAGNOSTIC_PUSH +HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS #include #include +HPP_FCL_COMPILER_DIAGNOSTIC_POP #include "fcl.hh" #include "deprecation.hh" @@ -91,6 +94,8 @@ void exposeCollisionAPI() { .def("clear", &CPUTimes::clear, arg("self"), "Reset the time values."); } +HPP_FCL_COMPILER_DIAGNOSTIC_PUSH +HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS if (!eigenpy::register_symbolic_link_to_registered_type()) { class_("QueryRequest", doxygen::class_doc(), no_init) @@ -127,7 +132,10 @@ void exposeCollisionAPI() { .DEF_RW_CLASS_ATTRIB(QueryRequest, enable_timings) .DEF_CLASS_FUNC(QueryRequest, updateGuess); } +HPP_FCL_COMPILER_DIAGNOSTIC_POP +HPP_FCL_COMPILER_DIAGNOSTIC_PUSH +HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS if (!eigenpy::register_symbolic_link_to_registered_type()) { class_ >( "CollisionRequest", doxygen::class_doc(), no_init) @@ -166,6 +174,7 @@ void exposeCollisionAPI() { class_ >("StdVec_CollisionRequest") .def(vector_indexing_suite >()); } +HPP_FCL_COMPILER_DIAGNOSTIC_POP if (!eigenpy::register_symbolic_link_to_registered_type()) { class_("Contact", doxygen::class_doc(), diff --git a/python/distance.cc b/python/distance.cc index 61aebf684..36d4ea014 100644 --- a/python/distance.cc +++ b/python/distance.cc @@ -36,10 +36,13 @@ #include "fcl.hh" +HPP_FCL_COMPILER_DIAGNOSTIC_PUSH +HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS #include #include #include #include "deprecation.hh" +HPP_FCL_COMPILER_DIAGNOSTIC_POP #include "serializable.hh" @@ -64,6 +67,8 @@ struct DistanceResultWrapper { }; void exposeDistanceAPI() { +HPP_FCL_COMPILER_DIAGNOSTIC_PUSH +HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS if (!eigenpy::register_symbolic_link_to_registered_type()) { class_ >( "DistanceRequest", doxygen::class_doc(), @@ -105,6 +110,7 @@ void exposeDistanceAPI() { .DEF_RW_CLASS_ATTRIB(DistanceRequest, abs_err) .def(SerializableVisitor()); } +HPP_FCL_COMPILER_DIAGNOSTIC_POP if (!eigenpy::register_symbolic_link_to_registered_type< std::vector >()) { From 76fab91f00bf6d248b909058eb9e5b878709d55a Mon Sep 17 00:00:00 2001 From: Wolfgang Merkt Date: Wed, 26 Jun 2024 17:50:10 +0100 Subject: [PATCH 6/7] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae10ad290..5f0dd9777 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed +- Compiler warnings ([#601](https://github.com/humanoid-path-planner/hpp-fcl/pull/601)) - CMake: fix assimp finder - Don't define GCC7 Boost serialization hack when `HPP_FCL_SKIP_EIGEN_BOOST_SERIALIZATION` is defined ([#530](https://github.com/humanoid-path-planner/hpp-fcl/pull/530)) - Default parameters for narrowphase algorithms (GJK and EPA); fixed assertion checks that were sometimes failing in GJK simplex projection and BVH `collide` ([#531](https://github.com/humanoid-path-planner/hpp-fcl/pull/531)). From a7afd251fb0df4f0b91ac80407151d8c5c01e371 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:53:08 +0000 Subject: [PATCH 7/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- python/collision.cc | 12 +-- python/distance.cc | 6 +- src/narrowphase/support_functions.cpp | 110 +++++++++++++------------- 3 files changed, 65 insertions(+), 63 deletions(-) diff --git a/python/collision.cc b/python/collision.cc index db7d13dff..a759b193a 100644 --- a/python/collision.cc +++ b/python/collision.cc @@ -94,8 +94,8 @@ void exposeCollisionAPI() { .def("clear", &CPUTimes::clear, arg("self"), "Reset the time values."); } -HPP_FCL_COMPILER_DIAGNOSTIC_PUSH -HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS + HPP_FCL_COMPILER_DIAGNOSTIC_PUSH + HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS if (!eigenpy::register_symbolic_link_to_registered_type()) { class_("QueryRequest", doxygen::class_doc(), no_init) @@ -132,10 +132,10 @@ HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS .DEF_RW_CLASS_ATTRIB(QueryRequest, enable_timings) .DEF_CLASS_FUNC(QueryRequest, updateGuess); } -HPP_FCL_COMPILER_DIAGNOSTIC_POP + HPP_FCL_COMPILER_DIAGNOSTIC_POP -HPP_FCL_COMPILER_DIAGNOSTIC_PUSH -HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS + HPP_FCL_COMPILER_DIAGNOSTIC_PUSH + HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS if (!eigenpy::register_symbolic_link_to_registered_type()) { class_ >( "CollisionRequest", doxygen::class_doc(), no_init) @@ -174,7 +174,7 @@ HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS class_ >("StdVec_CollisionRequest") .def(vector_indexing_suite >()); } -HPP_FCL_COMPILER_DIAGNOSTIC_POP + HPP_FCL_COMPILER_DIAGNOSTIC_POP if (!eigenpy::register_symbolic_link_to_registered_type()) { class_("Contact", doxygen::class_doc(), diff --git a/python/distance.cc b/python/distance.cc index 36d4ea014..0231814da 100644 --- a/python/distance.cc +++ b/python/distance.cc @@ -67,8 +67,8 @@ struct DistanceResultWrapper { }; void exposeDistanceAPI() { -HPP_FCL_COMPILER_DIAGNOSTIC_PUSH -HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS + HPP_FCL_COMPILER_DIAGNOSTIC_PUSH + HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS if (!eigenpy::register_symbolic_link_to_registered_type()) { class_ >( "DistanceRequest", doxygen::class_doc(), @@ -110,7 +110,7 @@ HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS .DEF_RW_CLASS_ATTRIB(DistanceRequest, abs_err) .def(SerializableVisitor()); } -HPP_FCL_COMPILER_DIAGNOSTIC_POP + HPP_FCL_COMPILER_DIAGNOSTIC_POP if (!eigenpy::register_symbolic_link_to_registered_type< std::vector >()) { diff --git a/src/narrowphase/support_functions.cpp b/src/narrowphase/support_functions.cpp index 898a002ea..5b39f152f 100644 --- a/src/narrowphase/support_functions.cpp +++ b/src/narrowphase/support_functions.cpp @@ -134,12 +134,13 @@ void getShapeSupport(const TriangleP* triangle, const Vec3f& dir, } // clang-format off getShapeSupportTplInstantiation(TriangleP) -// clang-format on + // clang-format on -// ============================================================================ -template -inline void getShapeSupport(const Box* box, const Vec3f& dir, Vec3f& support, - int& /*unused*/, ShapeSupportData& /*unused*/) { + // ============================================================================ + template + inline void getShapeSupport(const Box* box, const Vec3f& dir, + Vec3f& support, int& /*unused*/, + ShapeSupportData& /*unused*/) { // The inflate value is simply to make the specialized functions with box // have a preferred side for edge cases. static const FCL_REAL inflate = (dir.array() == 0).any() ? 1 + 1e-10 : 1.; @@ -156,13 +157,13 @@ inline void getShapeSupport(const Box* box, const Vec3f& dir, Vec3f& support, } // clang-format off getShapeSupportTplInstantiation(Box) -// clang-format on + // clang-format on -// ============================================================================ -template -inline void getShapeSupport(const Sphere* sphere, const Vec3f& dir, - Vec3f& support, int& /*unused*/, - ShapeSupportData& /*unused*/) { + // ============================================================================ + template + inline void getShapeSupport(const Sphere* sphere, const Vec3f& dir, + Vec3f& support, int& /*unused*/, + ShapeSupportData& /*unused*/) { if (_SupportOptions == SupportOptions::WithSweptSphere) { support.noalias() = (sphere->radius + sphere->getSweptSphereRadius()) * dir.normalized(); @@ -175,13 +176,13 @@ inline void getShapeSupport(const Sphere* sphere, const Vec3f& dir, } // clang-format off getShapeSupportTplInstantiation(Sphere) -// clang-format on + // clang-format on -// ============================================================================ -template -inline void getShapeSupport(const Ellipsoid* ellipsoid, const Vec3f& dir, - Vec3f& support, int& /*unused*/, - ShapeSupportData& /*unused*/) { + // ============================================================================ + template + inline void getShapeSupport(const Ellipsoid* ellipsoid, const Vec3f& dir, + Vec3f& support, int& /*unused*/, + ShapeSupportData& /*unused*/) { FCL_REAL a2 = ellipsoid->radii[0] * ellipsoid->radii[0]; FCL_REAL b2 = ellipsoid->radii[1] * ellipsoid->radii[1]; FCL_REAL c2 = ellipsoid->radii[2] * ellipsoid->radii[2]; @@ -198,13 +199,13 @@ inline void getShapeSupport(const Ellipsoid* ellipsoid, const Vec3f& dir, } // clang-format off getShapeSupportTplInstantiation(Ellipsoid) -// clang-format on + // clang-format on -// ============================================================================ -template -inline void getShapeSupport(const Capsule* capsule, const Vec3f& dir, - Vec3f& support, int& /*unused*/, - ShapeSupportData& /*unused*/) { + // ============================================================================ + template + inline void getShapeSupport(const Capsule* capsule, const Vec3f& dir, + Vec3f& support, int& /*unused*/, + ShapeSupportData& /*unused*/) { static const FCL_REAL dummy_precision = Eigen::NumTraits::dummy_precision(); support.setZero(); @@ -221,12 +222,12 @@ inline void getShapeSupport(const Capsule* capsule, const Vec3f& dir, } // clang-format off getShapeSupportTplInstantiation(Capsule) -// clang-format on + // clang-format on -// ============================================================================ -template -void getShapeSupport(const Cone* cone, const Vec3f& dir, Vec3f& support, - int& /*unused*/, ShapeSupportData& /*unused*/) { + // ============================================================================ + template + void getShapeSupport(const Cone* cone, const Vec3f& dir, Vec3f& support, + int& /*unused*/, ShapeSupportData& /*unused*/) { static const FCL_REAL dummy_precision = Eigen::NumTraits::dummy_precision(); @@ -273,12 +274,13 @@ void getShapeSupport(const Cone* cone, const Vec3f& dir, Vec3f& support, } // clang-format off getShapeSupportTplInstantiation(Cone) -// clang-format on + // clang-format on -// ============================================================================ -template -void getShapeSupport(const Cylinder* cylinder, const Vec3f& dir, Vec3f& support, - int& /*unused*/, ShapeSupportData& /*unused*/) { + // ============================================================================ + template + void getShapeSupport(const Cylinder* cylinder, const Vec3f& dir, + Vec3f& support, int& /*unused*/, + ShapeSupportData& /*unused*/) { static const FCL_REAL dummy_precision = Eigen::NumTraits::dummy_precision(); @@ -315,13 +317,13 @@ void getShapeSupport(const Cylinder* cylinder, const Vec3f& dir, Vec3f& support, } // clang-format off getShapeSupportTplInstantiation(Cylinder) -// clang-format on + // clang-format on -// ============================================================================ -template -void getShapeSupportLog(const ConvexBase* convex, const Vec3f& dir, - Vec3f& support, int& hint, - ShapeSupportData& support_data) { + // ============================================================================ + template + void getShapeSupportLog(const ConvexBase* convex, const Vec3f& dir, + Vec3f& support, int& hint, + ShapeSupportData& support_data) { assert(convex->neighbors != nullptr && "Convex has no neighbors."); // Use warm start if current support direction is distant from last support @@ -435,26 +437,26 @@ void getShapeSupport(const ConvexBase* convex, const Vec3f& dir, Vec3f& support, } // clang-format off getShapeSupportTplInstantiation(ConvexBase) -// clang-format on + // clang-format on -// ============================================================================ -template -inline void getShapeSupport(const SmallConvex* convex, const Vec3f& dir, - Vec3f& support, int& hint, - ShapeSupportData& support_data) { + // ============================================================================ + template + inline void getShapeSupport(const SmallConvex* convex, const Vec3f& dir, + Vec3f& support, int& hint, + ShapeSupportData& support_data) { getShapeSupportLinear<_SupportOptions>( reinterpret_cast(convex), dir, support, hint, support_data); } // clang-format off getShapeSupportTplInstantiation(SmallConvex) -// clang-format on + // clang-format on -// ============================================================================ -template -inline void getShapeSupport(const LargeConvex* convex, const Vec3f& dir, - Vec3f& support, int& hint, - ShapeSupportData& support_data) { + // ============================================================================ + template + inline void getShapeSupport(const LargeConvex* convex, const Vec3f& dir, + Vec3f& support, int& hint, + ShapeSupportData& support_data) { getShapeSupportLog<_SupportOptions>( reinterpret_cast(convex), dir, support, hint, support_data); @@ -468,9 +470,9 @@ getShapeSupportTplInstantiation(LargeConvex) getShapeSupportSet<_SupportOptions>(static_cast(shape), \ support_set, hint, support_data, \ max_num_supports, tol) -template -void getSupportSet(const ShapeBase* shape, SupportSet& support_set, int& hint, - size_t max_num_supports, FCL_REAL tol) { + template + void getSupportSet(const ShapeBase* shape, SupportSet& support_set, + int& hint, size_t max_num_supports, FCL_REAL tol) { ShapeSupportData support_data; switch (shape->getNodeType()) { case GEOM_TRIANGLE: