Skip to content

Commit

Permalink
fix map_server read gray images bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zikprid0 committed Oct 12, 2022
1 parent 31c550d commit a1229b3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nav2_map_server/src/map_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ void loadMapFromFile(
break;
case MapMode::Raw: {
double occ_percent = std::round(shade * 255);
if (0 <= occ_percent && occ_percent <= 100) {
// std::cout << "[DEBUG] [map_io]: (" << x << ", " << y << ") shade: " << shade << ", occ_percent: " << occ_percent << std::endl;
if (0 <= occ_percent && occ_percent <= 255) {
map_cell = static_cast<int8_t>(occ_percent);
} else {
map_cell = -1;
Expand Down

0 comments on commit a1229b3

Please sign in to comment.