cartographer-project / cartographer

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
Apache License 2.0
7.03k stars 2.24k forks source link

Eigen::Array2i GetCellIndex(...) #1920

Open sharknow opened 1 year ago

sharknow commented 1 year ago

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!