From 42f63f4c0e095449fea0e1c97ddd1ac60e0f27fd Mon Sep 17 00:00:00 2001 From: Justin Carpentier Date: Tue, 5 Apr 2022 08:54:55 +0200 Subject: [PATCH 1/2] cmake: sync submodule --- cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake b/cmake index 332976cc4..3d6176d43 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 332976cc4d5305256c79a479e55ad7ab2ecc42f1 +Subproject commit 3d6176d439963702d97b82555e3007de05a4e6a4 From 16dec3efe53cf6e7a75c2316497583117bc2f033 Mon Sep 17 00:00:00 2001 From: Justin Carpentier Date: Tue, 5 Apr 2022 15:59:05 +0200 Subject: [PATCH 2/2] python: fix distance method for DistanceCallBackBase --- python/broadphase/broadphase_callbacks.hh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/python/broadphase/broadphase_callbacks.hh b/python/broadphase/broadphase_callbacks.hh index 61f4fd346..fd21c4cae 100644 --- a/python/broadphase/broadphase_callbacks.hh +++ b/python/broadphase/broadphase_callbacks.hh @@ -74,10 +74,16 @@ struct CollisionCallBackBaseWrapper : CollisionCallBackBase, struct DistanceCallBackBaseWrapper : DistanceCallBackBase, bp::wrapper { typedef DistanceCallBackBase Base; + typedef DistanceCallBackBaseWrapper Self; void init() { this->get_override("init")(); } - bool distance(CollisionObject* o1, CollisionObject* o2) { - return this->get_override("distance")(o1, o2); + bool distance(CollisionObject* o1, CollisionObject* o2, + Eigen::Matrix& dist) { + return distance(o1, o2, dist.coeffRef(0, 0)); + } + + bool distance(CollisionObject* o1, CollisionObject* o2, FCL_REAL& dist) { + return this->get_override("distance")(o1, o2, dist); } static void expose() { @@ -85,7 +91,11 @@ struct DistanceCallBackBaseWrapper : DistanceCallBackBase, "DistanceCallBackBase", bp::no_init) .def("init", bp::pure_virtual(&Base::init), doxygen::member_func_doc(&Base::init)) - .def("distance", bp::pure_virtual(&Base::distance), + .def("distance", + bp::pure_virtual( + static_cast & dist)>(&Self::distance)), doxygen::member_func_doc(&Base::distance)) .def("__call__", &Base::operator(), doxygen::member_func_doc(&Base::operator()));