Skip to content

Commit

Permalink
Merge pull request #281 from jcarpent/devel
Browse files Browse the repository at this point in the history
Fix DistanceCallBackBaseWrapper
  • Loading branch information
jcarpent authored Apr 5, 2022
2 parents 6b8a549 + 16dec3e commit db0d063
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmake
Submodule cmake updated 3 files
+2 −0 base.cmake
+85 −0 coverage.cmake
+10 −2 test.cmake
16 changes: 13 additions & 3 deletions python/broadphase/broadphase_callbacks.hh
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,28 @@ struct CollisionCallBackBaseWrapper : CollisionCallBackBase,
struct DistanceCallBackBaseWrapper : DistanceCallBackBase,
bp::wrapper<DistanceCallBackBase> {
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<double, 1, 1>& 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() {
bp::class_<DistanceCallBackBaseWrapper, boost::noncopyable>(
"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<bool (Self::*)(
CollisionObject * o1, CollisionObject * o2,
Eigen::Matrix<double, 1, 1> & dist)>(&Self::distance)),
doxygen::member_func_doc(&Base::distance))
.def("__call__", &Base::operator(),
doxygen::member_func_doc(&Base::operator()));
Expand Down

0 comments on commit db0d063

Please sign in to comment.