37 #ifndef JSK_FOOTSTEP_PLANNER_ANN_GRID_H_ 38 #define JSK_FOOTSTEP_PLANNER_ANN_GRID_H_ 40 #include <boost/tuple/tuple.hpp> 41 #include <boost/unordered/unordered_set.hpp> 42 #include <pcl/point_types.h> 43 #include <pcl/point_cloud.h> 44 #include <pcl/PointIndices.h> 46 #include <opencv2/opencv.hpp> 56 typedef boost::unordered_set<size_t>
Indices;
59 virtual void add(
size_t i)
68 virtual void fill(Indices& out)
74 virtual void fill(std::vector<int>& out)
99 ANNGrid(
const double grid_size): grid_size_(grid_size) {}
104 virtual void build(
const pcl::PointCloud<pcl::PointNormal>&
cloud);
108 Eigen::Vector3f
v = p.getVector3fMap();
109 Eigen::Vector3f translated_point = v - min_point_;
110 int i = (int)std::floor(translated_point[0] / grid_size_);
111 int j = (int)std::floor(translated_point[1] / grid_size_);
112 return cv::Point(i, j);
117 Eigen::Vector3f translated_point = p - min_point_;
118 int i = (int)std::floor(translated_point[0] / grid_size_);
119 int j = (int)std::floor(translated_point[1] / grid_size_);
120 return cv::Point(i, j);
126 if (cells_.size() > i) {
127 if (cells_[i].
size() > j) {
139 virtual void approximateSearch(
const Eigen::Vector3f&
v, pcl::PointIndices& indices);
140 virtual IndexArray bresenham(
const Eigen::Vector3f& p0,
const Eigen::Vector3f&
p1);
142 virtual IndexArray
fill(
const IndexArray& filled);
143 virtual IndexArray fillByBox(
144 const Eigen::Vector3f& p0,
const Eigen::Vector3f& p1,
145 const Eigen::Vector3f&
p2,
const Eigen::Vector3f& p3);
146 virtual void approximateSearchInBox(
147 const Eigen::Vector3f& p0,
const Eigen::Vector3f& p1,
148 const Eigen::Vector3f& p2,
const Eigen::Vector3f& p3,
149 pcl::PointIndices& indices);
151 virtual IndexArray
box(
const Eigen::Vector3f& p0,
const Eigen::Vector3f& p1,
152 const Eigen::Vector3f& p2,
const Eigen::Vector3f& p3);
153 virtual void toImage(cv::Mat& mat);
154 virtual void toImage(cv::Mat& mat,
const IndexArray& pixels);
158 std::vector<std::vector<ANNGridCell::Ptr> >
cells_;