39#include <octomap/octomap.h>
43#include <shared_mutex>
66 tree_mutex_.lock_shared();
72 tree_mutex_.unlock_shared();
88 using ReadLock = std::shared_lock<std::shared_mutex>;
89 using WriteLock = std::unique_lock<std::shared_mutex>;
103 if (update_callback_)
110 update_callback_ = update_callback;
114 std::shared_mutex tree_mutex_;
115 std::function<void()> update_callback_;
void unlockWrite()
unlock the underlying octree.
OccMapTree(double resolution)
std::shared_lock< std::shared_mutex > ReadLock
void triggerUpdateCallback()
void setUpdateCallback(const std::function< void()> &update_callback)
Set the callback to trigger when updates are received.
void unlockRead()
unlock the underlying octree.
OccMapTree(const std::string &filename)
void lockRead()
lock the underlying octree. it will not be read or written by the monitor until unlockTree() is calle...
std::unique_lock< std::shared_mutex > WriteLock
void lockWrite()
lock the underlying octree. it will not be read or written by the monitor until unlockTree() is calle...
std::shared_ptr< const OccMapTree > OccMapTreeConstPtr
std::shared_ptr< OccMapTree > OccMapTreePtr
octomap::OcTreeNode OccMapNode