Fix ProbabilityPointsProcessor mirroring output (#419)

Fixes #414.
master
damienrg 2017-07-24 10:41:45 +02:00 committed by Holger Rapp
parent 6303a96bc8
commit 21cc270645
1 changed files with 3 additions and 4 deletions

View File

@ -21,8 +21,7 @@ void WriteGrid(const mapping_2d::ProbabilityGrid& probability_grid,
return; return;
} }
const auto grid_index_to_pixel = [cell_limits](const Eigen::Array2i& index) { const auto grid_index_to_pixel = [cell_limits](const Eigen::Array2i& index) {
return Eigen::Array2i(cell_limits.num_y_cells - index(1) - 1, return Eigen::Array2i(index(0), index(1));
cell_limits.num_x_cells - index(0) - 1);
}; };
const auto compute_color_value = [&probability_grid]( const auto compute_color_value = [&probability_grid](
const Eigen::Array2i& index) { const Eigen::Array2i& index) {
@ -36,8 +35,8 @@ void WriteGrid(const mapping_2d::ProbabilityGrid& probability_grid,
return kUnknownValue; return kUnknownValue;
} }
}; };
int width = cell_limits.num_y_cells; int width = cell_limits.num_x_cells;
int height = cell_limits.num_x_cells; int height = cell_limits.num_y_cells;
Image image(width, height); Image image(width, height);
for (auto xy_index : for (auto xy_index :
cartographer::mapping_2d::XYIndexRangeIterator(cell_limits)) { cartographer::mapping_2d::XYIndexRangeIterator(cell_limits)) {