Skip to content
Snippets Groups Projects
Commit bb558b51 authored by jpan's avatar jpan
Browse files

change octree shared_ptr to octomap as const, and remove non-const function

git-svn-id: https://kforge.ros.org/fcl/fcl_ros@154 253336fb-580f-4252-a368-f3cef5a2a82b
parent ac2776b1
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,7 @@ namespace fcl ...@@ -53,7 +53,7 @@ namespace fcl
class OcTree : public CollisionGeometry class OcTree : public CollisionGeometry
{ {
private: private:
boost::shared_ptr<octomap::OcTree> tree; boost::shared_ptr<const octomap::OcTree> tree;
public: public:
/// @brief OcTreeNode must implement the following interfaces: /// @brief OcTreeNode must implement the following interfaces:
...@@ -63,10 +63,10 @@ public: ...@@ -63,10 +63,10 @@ public:
typedef octomap::OcTreeNode OcTreeNode; typedef octomap::OcTreeNode OcTreeNode;
/// @brief construct octree with a given resolution /// @brief construct octree with a given resolution
OcTree(FCL_REAL resolution) : tree(boost::shared_ptr<octomap::OcTree>(new octomap::OcTree(resolution))) {} OcTree(FCL_REAL resolution) : tree(boost::shared_ptr<const octomap::OcTree>(new octomap::OcTree(resolution))) {}
/// @brief construct octree from octomap /// @brief construct octree from octomap
OcTree(const boost::shared_ptr<octomap::OcTree>& tree_) : tree(tree_) {} OcTree(const boost::shared_ptr<const octomap::OcTree>& tree_) : tree(tree_) {}
/// @brief compute the AABB for the octree in its local coordinate system /// @brief compute the AABB for the octree in its local coordinate system
void computeLocalAABB() void computeLocalAABB()
...@@ -107,12 +107,6 @@ public: ...@@ -107,12 +107,6 @@ public:
return (!isNodeOccupied(node)) && (!isNodeFree(node)); return (!isNodeOccupied(node)) && (!isNodeFree(node));
} }
/// @brief update the occupied information for a cell
inline void updateNode(FCL_REAL x, FCL_REAL y, FCL_REAL z, bool occupied)
{
tree->updateNode(octomap::point3d(x, y, z), occupied);
}
/// @brief transform the octree into a bunch of boxes; uncertainty information is kept in the boxes. However, we /// @brief transform the octree into a bunch of boxes; uncertainty information is kept in the boxes. However, we
/// only keep the occupied boxes (i.e., the boxes whose occupied probability is higher enough). /// only keep the occupied boxes (i.e., the boxes whose occupied probability is higher enough).
inline std::vector<boost::array<FCL_REAL, 6> > toBoxes() const inline std::vector<boost::array<FCL_REAL, 6> > toBoxes() const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment