Verified Commit 3e759fbf authored by Justin Carpentier's avatar Justin Carpentier
Browse files

python/octree: add bindings

parent 94569f25
......@@ -101,6 +101,10 @@ SET(${LIBRARY_NAME}_SOURCES
gjk.cc
)
IF(HPP_FCL_HAS_OCTOMAP)
LIST(APPEND ${LIBRARY_NAME}_SOURCES octree.cc)
ENDIF(HPP_FCL_HAS_OCTOMAP)
ADD_LIBRARY(${LIBRARY_NAME} SHARED ${${LIBRARY_NAME}_SOURCES} ${${LIBRARY_NAME}_HEADERS})
TARGET_INCLUDE_DIRECTORIES(${LIBRARY_NAME} SYSTEM PRIVATE ${PYTHON_INCLUDE_DIRS})
TARGET_INCLUDE_DIRECTORIES(${LIBRARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}/src" "${CMAKE_CURRENT_BINARY_DIR}")
......
......@@ -98,4 +98,7 @@ BOOST_PYTHON_MODULE(hppfcl)
exposeCollisionAPI();
exposeDistanceAPI();
exposeGJK();
#ifdef HPP_FCL_HAS_OCTOMAP
exposeOctree();
#endif
}
......@@ -18,3 +18,7 @@ void exposeCollisionAPI();
void exposeDistanceAPI();
void exposeGJK();
#ifdef HPP_FCL_HAS_OCTOMAP
void exposeOctree();
#endif
#include <boost/python.hpp>
#include <hpp/fcl/fwd.hh>
#include <hpp/fcl/octree.h>
#include "fcl.hh"
#ifdef HPP_FCL_HAS_DOXYGEN_AUTODOC
#include "doxygen_autodoc/functions.h"
#endif
#include "../doc/python/doxygen.hh"
#include "../doc/python/doxygen-boost.hh"
void exposeOctree()
{
using namespace hpp::fcl;
namespace bp = boost::python;
namespace dv = doxygen::visitor;
bp::class_<OcTree, bp::bases<CollisionGeometry> >("OcTree",doxygen::class_doc<OcTree>(),bp::no_init)
.def(dv::init<OcTree,FCL_REAL>())
.def(dv::member_func("getTreeDepth",&OcTree::getTreeDepth))
.def(dv::member_func("getOccupancyThres",&OcTree::getOccupancyThres))
.def(dv::member_func("getFreeThres",&OcTree::getFreeThres))
.def(dv::member_func("getDefaultOccupancy",&OcTree::getDefaultOccupancy))
.def(dv::member_func("setCellDefaultOccupancy",&OcTree::setCellDefaultOccupancy))
.def(dv::member_func("setOccupancyThres",&OcTree::setOccupancyThres))
.def(dv::member_func("setFreeThres",&OcTree::setFreeThres))
.def(dv::member_func("getRootBV",&OcTree::getRootBV))
;
doxygen::def("makeOctree",&makeOctree);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment