File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -411,19 +411,24 @@ void buildMap() {
411411 for (const auto & area : map_data.areas ) {
412412 if (!area.active ) continue ;
413413
414- double value;
415414 if (area.type == " mow" || area.type == " nav" ) {
416- value = 0.0 ;
417- } else if (area. type == " obstacle " ) {
418- value = 1.0 ;
419- } else {
420- continue ;
415+ grid_map::Polygon poly = internalPolygonToGridMap (area. outline ) ;
416+ for (grid_map::PolygonIterator iterator (map, poly); !iterator. isPastEnd (); ++iterator ) {
417+ const grid_map::Index index (*iterator) ;
418+ data (index[ 0 ], index[ 1 ]) = 0.0 ;
419+ }
421420 }
421+ }
422422
423- grid_map::Polygon poly = internalPolygonToGridMap (area.outline );
424- for (grid_map::PolygonIterator iterator (map, poly); !iterator.isPastEnd (); ++iterator) {
425- const grid_map::Index index (*iterator);
426- data (index[0 ], index[1 ]) = value;
423+ for (const auto & area : map_data.areas ) {
424+ if (!area.active ) continue ;
425+
426+ if (area.type == " obstacle" ) {
427+ grid_map::Polygon poly = internalPolygonToGridMap (area.outline );
428+ for (grid_map::PolygonIterator iterator (map, poly); !iterator.isPastEnd (); ++iterator) {
429+ const grid_map::Index index (*iterator);
430+ data (index[0 ], index[1 ]) = 1.0 ;
431+ }
427432 }
428433 }
429434
You can’t perform that action at this time.
0 commit comments