Skip to content

Commit

Permalink
Merge pull request #601 from wxmerkt/topic/wxm-fix-bunch-of-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarpent authored Jun 28, 2024
2 parents 4674799 + a7afd25 commit 2a7e554
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 96 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
Expand Down
12 changes: 6 additions & 6 deletions include/hpp/fcl/internal/shape_shape_contact_patch_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <> \
Expand Down Expand Up @@ -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
Expand Down
52 changes: 26 additions & 26 deletions include/hpp/fcl/internal/shape_shape_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/hpp/fcl/math/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<FCL_REAL>(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);
Expand Down
2 changes: 1 addition & 1 deletion include/hpp/fcl/serialization/contact_patch.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void serialize(Archive& ar, hpp::fcl::ContactPatch& contact_patch,
}
Eigen::Map<PolygonPoints> points_map(
reinterpret_cast<FCL_REAL*>(contact_patch.points().data()), 2,
patch_size);
static_cast<Eigen::Index>(patch_size));
ar& make_nvp("points", points_map);
}

Expand Down
6 changes: 6 additions & 0 deletions python/broadphase/broadphase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down Expand Up @@ -134,3 +139,4 @@ void exposeBroadPhase() {
bp::optional<unsigned int>>());
}
}
HPP_FCL_COMPILER_DIAGNOSTIC_POP
9 changes: 9 additions & 0 deletions python/collision.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@
#include <eigenpy/eigenpy.hpp>

#include <hpp/fcl/fwd.hh>
HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
#include <hpp/fcl/collision.h>
#include <hpp/fcl/serialization/collision_data.h>
HPP_FCL_COMPILER_DIAGNOSTIC_POP

#include "fcl.hh"
#include "deprecation.hh"
Expand Down Expand Up @@ -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<QueryRequest>()) {
class_<QueryRequest>("QueryRequest", doxygen::class_doc<QueryRequest>(),
no_init)
Expand Down Expand Up @@ -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<CollisionRequest>()) {
class_<CollisionRequest, bases<QueryRequest> >(
"CollisionRequest", doxygen::class_doc<CollisionRequest>(), no_init)
Expand Down Expand Up @@ -166,6 +174,7 @@ void exposeCollisionAPI() {
class_<std::vector<CollisionRequest> >("StdVec_CollisionRequest")
.def(vector_indexing_suite<std::vector<CollisionRequest> >());
}
HPP_FCL_COMPILER_DIAGNOSTIC_POP

if (!eigenpy::register_symbolic_link_to_registered_type<Contact>()) {
class_<Contact>("Contact", doxygen::class_doc<Contact>(),
Expand Down
6 changes: 6 additions & 0 deletions python/distance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@

#include "fcl.hh"

HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
#include <hpp/fcl/fwd.hh>
#include <hpp/fcl/distance.h>
#include <hpp/fcl/serialization/collision_data.h>
#include "deprecation.hh"
HPP_FCL_COMPILER_DIAGNOSTIC_POP

#include "serializable.hh"

Expand All @@ -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<DistanceRequest>()) {
class_<DistanceRequest, bases<QueryRequest> >(
"DistanceRequest", doxygen::class_doc<DistanceRequest>(),
Expand Down Expand Up @@ -105,6 +110,7 @@ void exposeDistanceAPI() {
.DEF_RW_CLASS_ATTRIB(DistanceRequest, abs_err)
.def(SerializableVisitor<DistanceRequest>());
}
HPP_FCL_COMPILER_DIAGNOSTIC_POP

if (!eigenpy::register_symbolic_link_to_registered_type<
std::vector<DistanceRequest> >()) {
Expand Down
Loading

0 comments on commit 2a7e554

Please sign in to comment.