17 #ifndef CARTOGRAPHER_MAPPING_2D_XY_INDEX_H_ 18 #define CARTOGRAPHER_MAPPING_2D_XY_INDEX_H_ 28 #include "cartographer/mapping/proto/2d/cell_limits.pb.h" 29 #include "glog/logging.h" 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_ bool operator!=(const XYIndexRangeIterator &other) const
bool operator==(const XYIndexRangeIterator &other) const
Eigen::Array2i & operator*()
CellLimits(int init_num_x_cells, int init_num_y_cells)
Eigen::Array2i max_xy_index_
XYIndexRangeIterator & operator++()
Eigen::Array2i min_xy_index_
XYIndexRangeIterator begin()
XYIndexRangeIterator end()
CellLimits(const proto::CellLimits &cell_limits)
XYIndexRangeIterator(const Eigen::Array2i &min_xy_index, const Eigen::Array2i &max_xy_index)
XYIndexRangeIterator(const CellLimits &cell_limits)
proto::MapLimits ToProto(const MapLimits &map_limits)