Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
In cartographer/mapping/2d/map_limits.h
Eigen::Array2i GetCellIndex(const Eigen::Vector2f& point) const {
// Index values are row major and the top left has Eigen::Array2i::Zero()
// and contains (centered_max_x, centered_maxy). We need to flip and
// rotate.
return Eigen::Array2i(
common::RoundToInt((max.y() - point.y()) / resolution - 0.5),
common::RoundToInt((max.x() - point.x()) / resolution - 0.5));
}
I think this should be:
return Eigen::Array2i(
common::RoundToInt((max.x() - point.x()) / resolution - 0.5),
common::RoundToInt((max.y() - point.y()) / resolution_ - 0.5));
In cartographer/mapping/2d/map_limits.h Eigen::Array2i GetCellIndex(const Eigen::Vector2f& point) const { // Index values are row major and the top left has Eigen::Array2i::Zero() // and contains (centered_max_x, centered_maxy). We need to flip and // rotate. return Eigen::Array2i( common::RoundToInt((max.y() - point.y()) / resolution - 0.5), common::RoundToInt((max.x() - point.x()) / resolution - 0.5)); } I think this should be: return Eigen::Array2i( common::RoundToInt((max.x() - point.x()) / resolution - 0.5), common::RoundToInt((max.y() - point.y()) / resolution_ - 0.5));
thanks!