@@ -86,7 +86,7 @@ void GridMapVisual::computeVisualization(float alpha, bool showGridLines, bool f
86
86
}
87
87
const double resolution = map_.getResolution ();
88
88
const grid_map::Matrix& heightData = map_[flatTerrain ? layerNames[0 ] : heightLayer];
89
- const grid_map::Matrix& colorData = map_[flatColor ? layerNames[0 ] : colorLayer];
89
+ const grid_map::Matrix& colorData = map_[( flatColor || noColor) ? layerNames[0 ] : colorLayer];
90
90
91
91
// Reset and begin the manualObject (mesh).
92
92
// For more information: https://www.ogre3d.org/docs/api/1.7/class_ogre_1_1_manual_object.html#details
@@ -103,7 +103,7 @@ void GridMapVisual::computeVisualization(float alpha, bool showGridLines, bool f
103
103
104
104
// Compute a mask of valid cells.
105
105
auto basicLayers = map_.getBasicLayers ();
106
- if (std::find (basicLayers.begin (), basicLayers.end (), heightLayer) == basicLayers.end ()) {
106
+ if (!flatTerrain && std::find (basicLayers.begin (), basicLayers.end (), heightLayer) == basicLayers.end ()) {
107
107
basicLayers.emplace_back (heightLayer);
108
108
}
109
109
const MaskArray isValid = computeIsValidMask (basicLayers);
@@ -118,7 +118,7 @@ void GridMapVisual::computeVisualization(float alpha, bool showGridLines, bool f
118
118
119
119
// Compute the color data for each cell.
120
120
ColoringMethod coloringMethod;
121
- if (flatColor) {
121
+ if (flatColor || noColor ) {
122
122
coloringMethod = ColoringMethod::FLAT;
123
123
} else if (mapLayerColor) {
124
124
coloringMethod = ColoringMethod::COLOR_LAYER;
0 commit comments