17 #ifndef CARTOGRAPHER_MAPPING_2D_XY_INDEX_H_ 18 #define CARTOGRAPHER_MAPPING_2D_XY_INDEX_H_ 28 #include "cartographer/mapping_2d/proto/cell_limits.pb.h" 29 #include "glog/logging.h" 32 namespace mapping_2d {
39 explicit CellLimits(
const proto::CellLimits& cell_limits)
48 proto::CellLimits result;
56 :
public std::iterator<std::input_iterator_tag, Eigen::Array2i> {
60 const Eigen::Array2i& max_xy_index)
61 : min_xy_index_(min_xy_index),
62 max_xy_index_(max_xy_index),
63 xy_index_(min_xy_index) {}
75 DCHECK(*
this != end());
76 if (xy_index_.x() < max_xy_index_.x()) {
79 xy_index_.x() = min_xy_index_.x();
88 return (xy_index_ == other.
xy_index_).all();
92 return !operator==(other);
101 it.
xy_index_ = Eigen::Array2i(min_xy_index_.x(), max_xy_index_.y() + 1);
114 #endif // CARTOGRAPHER_MAPPING_2D_XY_INDEX_H_
XYIndexRangeIterator & operator++()
XYIndexRangeIterator(const Eigen::Array2i &min_xy_index, const Eigen::Array2i &max_xy_index)
bool operator==(const XYIndexRangeIterator &other) const
Eigen::Array2i & operator*()
XYIndexRangeIterator end()
XYIndexRangeIterator begin()
Eigen::Array2i min_xy_index_
CellLimits(int init_num_x_cells, int init_num_y_cells)
CellLimits(const proto::CellLimits &cell_limits)
XYIndexRangeIterator(const CellLimits &cell_limits)
bool operator!=(const XYIndexRangeIterator &other) const
proto::MapLimits ToProto(const MapLimits &map_limits)
Eigen::Array2i max_xy_index_