41 #include <unordered_map>
42 #include <condition_variable>
53 void pushLazyUpdate(octomap::KeySet* occupied_cells, octomap::KeySet* model_cells,
54 const octomap::point3d& sensor_origin);
58 typedef std::unordered_map<octomap::OcTreeKey, unsigned int, octomap::OcTreeKey::KeyHash> OcTreeKeyCountMap;
59 #elif __cplusplus >= 201103L
60 typedef std::unordered_map<octomap::OcTreeKey, unsigned int, octomap::OcTreeKey::KeyHash> OcTreeKeyCountMap;
62 typedef std::tr1::unordered_map<octomap::OcTreeKey, unsigned int, octomap::OcTreeKey::KeyHash> OcTreeKeyCountMap;
65 void pushBatchToProcess(OcTreeKeyCountMap* occupied_cells, octomap::KeySet* model_cells,
66 const octomap::point3d& sensor_origin);
68 void lazyUpdateThread();
73 std::size_t max_batch_size_;
74 double max_sensor_delta_;
76 std::deque<octomap::KeySet*> occupied_cells_sets_;
77 std::deque<octomap::KeySet*> model_cells_sets_;
78 std::deque<octomap::point3d> sensor_origins_;
79 std::condition_variable update_condition_;
80 std::mutex update_cell_sets_lock_;
82 OcTreeKeyCountMap* process_occupied_cells_set_;
83 octomap::KeySet* process_model_cells_set_;
84 octomap::point3d process_sensor_origin_;
85 std::condition_variable process_condition_;
86 std::mutex cell_process_lock_;
88 std::thread update_thread_;
89 std::thread process_thread_;
void pushLazyUpdate(octomap::KeySet *occupied_cells, octomap::KeySet *model_cells, const octomap::point3d &sensor_origin)
LazyFreeSpaceUpdater(const collision_detection::OccMapTreePtr &tree, unsigned int max_batch_size=10)
std::shared_ptr< OccMapTree > OccMapTreePtr