Nav2 Navigation Stack - humble  humble
ROS 2 Navigation Stack
costmap_2d.cpp
1 /*********************************************************************
2  *
3  * Software License Agreement (BSD License)
4  *
5  * Copyright (c) 2008, 2013, Willow Garage, Inc.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of Willow Garage, Inc. nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  *
35  * Author: Eitan Marder-Eppstein
36  * David V. Lu!!
37  *********************************************************************/
38 #include "nav2_costmap_2d/costmap_2d.hpp"
39 
40 #include <algorithm>
41 #include <cstdio>
42 #include <string>
43 #include <vector>
44 #include "nav2_costmap_2d/cost_values.hpp"
45 #include "nav2_util/occ_grid_values.hpp"
46 
47 namespace nav2_costmap_2d
48 {
50  unsigned int cells_size_x, unsigned int cells_size_y, double resolution,
51  double origin_x, double origin_y, unsigned char default_value)
52 : size_x_(cells_size_x), size_y_(cells_size_y), resolution_(resolution), origin_x_(origin_x),
53  origin_y_(origin_y), costmap_(NULL), default_value_(default_value)
54 {
55  access_ = new mutex_t();
56 
57  // create the costmap
58  initMaps(size_x_, size_y_);
59  resetMaps();
60 }
61 
62 Costmap2D::Costmap2D(const nav_msgs::msg::OccupancyGrid & map)
63 : default_value_(FREE_SPACE)
64 {
65  access_ = new mutex_t();
66 
67  // fill local variables
68  size_x_ = map.info.width;
69  size_y_ = map.info.height;
70  resolution_ = map.info.resolution;
71  origin_x_ = map.info.origin.position.x;
72  origin_y_ = map.info.origin.position.y;
73 
74  // create the costmap
75  costmap_ = new unsigned char[size_x_ * size_y_];
76 
77  // fill the costmap with a data
78  int8_t data;
79  for (unsigned int it = 0; it < size_x_ * size_y_; it++) {
80  data = map.data[it];
81  if (data == nav2_util::OCC_GRID_UNKNOWN) {
82  costmap_[it] = NO_INFORMATION;
83  } else {
84  // Linear conversion from OccupancyGrid data range [OCC_GRID_FREE..OCC_GRID_OCCUPIED]
85  // to costmap data range [FREE_SPACE..LETHAL_OBSTACLE]
86  costmap_[it] = std::round(
87  static_cast<double>(data) * (LETHAL_OBSTACLE - FREE_SPACE) /
88  (nav2_util::OCC_GRID_OCCUPIED - nav2_util::OCC_GRID_FREE));
89  }
90  }
91 }
92 
94 {
95  // clean up data
96  std::unique_lock<mutex_t> lock(*access_);
97  delete[] costmap_;
98  costmap_ = NULL;
99 }
100 
101 void Costmap2D::initMaps(unsigned int size_x, unsigned int size_y)
102 {
103  std::unique_lock<mutex_t> lock(*access_);
104  delete[] costmap_;
105  costmap_ = new unsigned char[size_x * size_y];
106 }
107 
109  unsigned int size_x, unsigned int size_y, double resolution,
110  double origin_x, double origin_y)
111 {
112  size_x_ = size_x;
113  size_y_ = size_y;
114  resolution_ = resolution;
115  origin_x_ = origin_x;
116  origin_y_ = origin_y;
117 
118  initMaps(size_x, size_y);
119 
120  // reset our maps to have no information
121  resetMaps();
122 }
123 
125 {
126  std::unique_lock<mutex_t> lock(*access_);
127  memset(costmap_, default_value_, size_x_ * size_y_ * sizeof(unsigned char));
128 }
129 
130 void Costmap2D::resetMap(unsigned int x0, unsigned int y0, unsigned int xn, unsigned int yn)
131 {
132  resetMapToValue(x0, y0, xn, yn, default_value_);
133 }
134 
136  unsigned int x0, unsigned int y0, unsigned int xn, unsigned int yn, unsigned char value)
137 {
138  std::unique_lock<mutex_t> lock(*(access_));
139  unsigned int len = xn - x0;
140  for (unsigned int y = y0 * size_x_ + x0; y < yn * size_x_ + x0; y += size_x_) {
141  memset(costmap_ + y, value, len * sizeof(unsigned char));
142  }
143 }
144 
146  const Costmap2D & map, double win_origin_x, double win_origin_y,
147  double win_size_x,
148  double win_size_y)
149 {
150  // check for self windowing
151  if (this == &map) {
152  // ROS_ERROR("Cannot convert this costmap into a window of itself");
153  return false;
154  }
155 
156  // clean up old data
157  deleteMaps();
158 
159  // compute the bounds of our new map
160  unsigned int lower_left_x, lower_left_y, upper_right_x, upper_right_y;
161  if (!map.worldToMap(win_origin_x, win_origin_y, lower_left_x, lower_left_y) ||
162  !map.worldToMap(
163  win_origin_x + win_size_x, win_origin_y + win_size_y, upper_right_x,
164  upper_right_y))
165  {
166  // ROS_ERROR("Cannot window a map that the window bounds don't fit inside of");
167  return false;
168  }
169 
170  size_x_ = upper_right_x - lower_left_x;
171  size_y_ = upper_right_y - lower_left_y;
172  resolution_ = map.resolution_;
173  origin_x_ = win_origin_x;
174  origin_y_ = win_origin_y;
175 
176  // initialize our various maps and reset markers for inflation
177  initMaps(size_x_, size_y_);
178 
179  // copy the window of the static map and the costmap that we're taking
181  map.costmap_, lower_left_x, lower_left_y, map.size_x_, costmap_, 0, 0, size_x_,
182  size_x_,
183  size_y_);
184  return true;
185 }
186 
188  const Costmap2D & source,
189  unsigned int sx0, unsigned int sy0, unsigned int sxn, unsigned int syn,
190  unsigned int dx0, unsigned int dy0)
191 {
192  const unsigned int sz_x = sxn - sx0;
193  const unsigned int sz_y = syn - sy0;
194 
195  if (sxn > source.getSizeInCellsX() || syn > source.getSizeInCellsY()) {
196  return false;
197  }
198 
199  if (dx0 + sz_x > size_x_ || dy0 + sz_y > size_y_) {
200  return false;
201  }
202 
204  source.costmap_, sx0, sy0, source.size_x_,
205  costmap_, dx0, dy0, size_x_,
206  sz_x, sz_y);
207  return true;
208 }
209 
211 {
212  // check for self assignement
213  if (this == &map) {
214  return *this;
215  }
216 
217  // clean up old data
218  deleteMaps();
219 
220  size_x_ = map.size_x_;
221  size_y_ = map.size_y_;
222  resolution_ = map.resolution_;
223  origin_x_ = map.origin_x_;
224  origin_y_ = map.origin_y_;
225 
226  // initialize our various maps
227  initMaps(size_x_, size_y_);
228 
229  // copy the cost map
230  memcpy(costmap_, map.costmap_, size_x_ * size_y_ * sizeof(unsigned char));
231 
232  return *this;
233 }
234 
236 : costmap_(NULL)
237 {
238  access_ = new mutex_t();
239  *this = map;
240 }
241 
242 // just initialize everything to NULL by default
244 : size_x_(0), size_y_(0), resolution_(0.0), origin_x_(0.0), origin_y_(0.0), costmap_(NULL)
245 {
246  access_ = new mutex_t();
247 }
248 
250 {
251  deleteMaps();
252  delete access_;
253 }
254 
255 unsigned int Costmap2D::cellDistance(double world_dist)
256 {
257  double cells_dist = std::max(0.0, ceil(world_dist / resolution_));
258  return (unsigned int)cells_dist;
259 }
260 
261 unsigned char * Costmap2D::getCharMap() const
262 {
263  return costmap_;
264 }
265 
266 unsigned char Costmap2D::getCost(unsigned int mx, unsigned int my) const
267 {
268  return costmap_[getIndex(mx, my)];
269 }
270 
271 unsigned char Costmap2D::getCost(unsigned int undex) const
272 {
273  return costmap_[undex];
274 }
275 
276 void Costmap2D::setCost(unsigned int mx, unsigned int my, unsigned char cost)
277 {
278  costmap_[getIndex(mx, my)] = cost;
279 }
280 
281 void Costmap2D::mapToWorld(unsigned int mx, unsigned int my, double & wx, double & wy) const
282 {
283  wx = origin_x_ + (mx + 0.5) * resolution_;
284  wy = origin_y_ + (my + 0.5) * resolution_;
285 }
286 
287 bool Costmap2D::worldToMap(double wx, double wy, unsigned int & mx, unsigned int & my) const
288 {
289  if (wx < origin_x_ || wy < origin_y_) {
290  return false;
291  }
292 
293  mx = static_cast<unsigned int>((wx - origin_x_) / resolution_);
294  my = static_cast<unsigned int>((wy - origin_y_) / resolution_);
295 
296  if (mx < size_x_ && my < size_y_) {
297  return true;
298  }
299  return false;
300 }
301 
302 void Costmap2D::worldToMapNoBounds(double wx, double wy, int & mx, int & my) const
303 {
304  mx = static_cast<int>((wx - origin_x_) / resolution_);
305  my = static_cast<int>((wy - origin_y_) / resolution_);
306 }
307 
308 void Costmap2D::worldToMapEnforceBounds(double wx, double wy, int & mx, int & my) const
309 {
310  // Here we avoid doing any math to wx,wy before comparing them to
311  // the bounds, so their values can go out to the max and min values
312  // of double floating point.
313  if (wx < origin_x_) {
314  mx = 0;
315  } else if (wx > resolution_ * size_x_ + origin_x_) {
316  mx = size_x_ - 1;
317  } else {
318  mx = static_cast<int>((wx - origin_x_) / resolution_);
319  }
320 
321  if (wy < origin_y_) {
322  my = 0;
323  } else if (wy > resolution_ * size_y_ + origin_y_) {
324  my = size_y_ - 1;
325  } else {
326  my = static_cast<int>((wy - origin_y_) / resolution_);
327  }
328 }
329 
330 void Costmap2D::updateOrigin(double new_origin_x, double new_origin_y)
331 {
332  // project the new origin into the grid
333  int cell_ox, cell_oy;
334  cell_ox = static_cast<int>((new_origin_x - origin_x_) / resolution_);
335  cell_oy = static_cast<int>((new_origin_y - origin_y_) / resolution_);
336 
337  // compute the associated world coordinates for the origin cell
338  // because we want to keep things grid-aligned
339  double new_grid_ox, new_grid_oy;
340  new_grid_ox = origin_x_ + cell_ox * resolution_;
341  new_grid_oy = origin_y_ + cell_oy * resolution_;
342 
343  // To save casting from unsigned int to int a bunch of times
344  int size_x = size_x_;
345  int size_y = size_y_;
346 
347  // we need to compute the overlap of the new and existing windows
348  int lower_left_x, lower_left_y, upper_right_x, upper_right_y;
349  lower_left_x = std::min(std::max(cell_ox, 0), size_x);
350  lower_left_y = std::min(std::max(cell_oy, 0), size_y);
351  upper_right_x = std::min(std::max(cell_ox + size_x, 0), size_x);
352  upper_right_y = std::min(std::max(cell_oy + size_y, 0), size_y);
353 
354  unsigned int cell_size_x = upper_right_x - lower_left_x;
355  unsigned int cell_size_y = upper_right_y - lower_left_y;
356 
357  // we need a map to store the obstacles in the window temporarily
358  unsigned char * local_map = new unsigned char[cell_size_x * cell_size_y];
359 
360  // copy the local window in the costmap to the local map
362  costmap_, lower_left_x, lower_left_y, size_x_, local_map, 0, 0, cell_size_x,
363  cell_size_x,
364  cell_size_y);
365 
366  // now we'll set the costmap to be completely unknown if we track unknown space
367  resetMaps();
368 
369  // update the origin with the appropriate world coordinates
370  origin_x_ = new_grid_ox;
371  origin_y_ = new_grid_oy;
372 
373  // compute the starting cell location for copying data back in
374  int start_x = lower_left_x - cell_ox;
375  int start_y = lower_left_y - cell_oy;
376 
377  // now we want to copy the overlapping information back into the map, but in its new location
379  local_map, 0, 0, cell_size_x, costmap_, start_x, start_y, size_x_, cell_size_x,
380  cell_size_y);
381 
382  // make sure to clean up
383  delete[] local_map;
384 }
385 
387  const std::vector<geometry_msgs::msg::Point> & polygon,
388  unsigned char cost_value)
389 {
390  // we assume the polygon is given in the global_frame...
391  // we need to transform it to map coordinates
392  std::vector<MapLocation> map_polygon;
393  for (unsigned int i = 0; i < polygon.size(); ++i) {
394  MapLocation loc;
395  if (!worldToMap(polygon[i].x, polygon[i].y, loc.x, loc.y)) {
396  // ("Polygon lies outside map bounds, so we can't fill it");
397  return false;
398  }
399  map_polygon.push_back(loc);
400  }
401 
402  std::vector<MapLocation> polygon_cells;
403 
404  // get the cells that fill the polygon
405  convexFillCells(map_polygon, polygon_cells);
406 
407  // set the cost of those cells
408  for (unsigned int i = 0; i < polygon_cells.size(); ++i) {
409  unsigned int index = getIndex(polygon_cells[i].x, polygon_cells[i].y);
410  costmap_[index] = cost_value;
411  }
412  return true;
413 }
414 
416  const std::vector<MapLocation> & polygon,
417  std::vector<MapLocation> & polygon_cells)
418 {
419  PolygonOutlineCells cell_gatherer(*this, costmap_, polygon_cells);
420  for (unsigned int i = 0; i < polygon.size() - 1; ++i) {
421  raytraceLine(cell_gatherer, polygon[i].x, polygon[i].y, polygon[i + 1].x, polygon[i + 1].y);
422  }
423  if (!polygon.empty()) {
424  unsigned int last_index = polygon.size() - 1;
425  // we also need to close the polygon by going from the last point to the first
426  raytraceLine(
427  cell_gatherer, polygon[last_index].x, polygon[last_index].y, polygon[0].x,
428  polygon[0].y);
429  }
430 }
431 
433  const std::vector<MapLocation> & polygon,
434  std::vector<MapLocation> & polygon_cells)
435 {
436  // we need a minimum polygon of a triangle
437  if (polygon.size() < 3) {
438  return;
439  }
440 
441  // first get the cells that make up the outline of the polygon
442  polygonOutlineCells(polygon, polygon_cells);
443 
444  // quick bubble sort to sort points by x
445  MapLocation swap;
446  unsigned int i = 0;
447  while (i < polygon_cells.size() - 1) {
448  if (polygon_cells[i].x > polygon_cells[i + 1].x) {
449  swap = polygon_cells[i];
450  polygon_cells[i] = polygon_cells[i + 1];
451  polygon_cells[i + 1] = swap;
452 
453  if (i > 0) {
454  --i;
455  }
456  } else {
457  ++i;
458  }
459  }
460 
461  i = 0;
462  MapLocation min_pt;
463  MapLocation max_pt;
464  unsigned int min_x = polygon_cells[0].x;
465  unsigned int max_x = polygon_cells[polygon_cells.size() - 1].x;
466 
467  // walk through each column and mark cells inside the polygon
468  for (unsigned int x = min_x; x <= max_x; ++x) {
469  if (i >= polygon_cells.size() - 1) {
470  break;
471  }
472 
473  if (polygon_cells[i].y < polygon_cells[i + 1].y) {
474  min_pt = polygon_cells[i];
475  max_pt = polygon_cells[i + 1];
476  } else {
477  min_pt = polygon_cells[i + 1];
478  max_pt = polygon_cells[i];
479  }
480 
481  i += 2;
482  while (i < polygon_cells.size() && polygon_cells[i].x == x) {
483  if (polygon_cells[i].y < min_pt.y) {
484  min_pt = polygon_cells[i];
485  } else if (polygon_cells[i].y > max_pt.y) {
486  max_pt = polygon_cells[i];
487  }
488  ++i;
489  }
490 
491  MapLocation pt;
492  // loop though cells in the column
493  for (unsigned int y = min_pt.y; y <= max_pt.y; ++y) {
494  pt.x = x;
495  pt.y = y;
496  polygon_cells.push_back(pt);
497  }
498  }
499 }
500 
501 unsigned int Costmap2D::getSizeInCellsX() const
502 {
503  return size_x_;
504 }
505 
506 unsigned int Costmap2D::getSizeInCellsY() const
507 {
508  return size_y_;
509 }
510 
512 {
513  return (size_x_ - 1 + 0.5) * resolution_;
514 }
515 
517 {
518  return (size_y_ - 1 + 0.5) * resolution_;
519 }
520 
521 double Costmap2D::getOriginX() const
522 {
523  return origin_x_;
524 }
525 
526 double Costmap2D::getOriginY() const
527 {
528  return origin_y_;
529 }
530 
532 {
533  return resolution_;
534 }
535 
536 bool Costmap2D::saveMap(std::string file_name)
537 {
538  FILE * fp = fopen(file_name.c_str(), "w");
539 
540  if (!fp) {
541  return false;
542  }
543 
544  fprintf(fp, "P2\n%u\n%u\n%u\n", size_x_, size_y_, 0xff);
545  for (unsigned int iy = 0; iy < size_y_; iy++) {
546  for (unsigned int ix = 0; ix < size_x_; ix++) {
547  unsigned char cost = getCost(ix, iy);
548  fprintf(fp, "%d ", cost);
549  }
550  fprintf(fp, "\n");
551  }
552  fclose(fp);
553  return true;
554 }
555 
556 } // namespace nav2_costmap_2d
A 2D costmap provides a mapping between points in the world and their associated "costs".
Definition: costmap_2d.hpp:68
void mapToWorld(unsigned int mx, unsigned int my, double &wx, double &wy) const
Convert from map coordinates to world coordinates.
Definition: costmap_2d.cpp:281
void resetMap(unsigned int x0, unsigned int y0, unsigned int xn, unsigned int yn)
Reset the costmap in bounds.
Definition: costmap_2d.cpp:130
unsigned int getIndex(unsigned int mx, unsigned int my) const
Given two map coordinates... compute the associated index.
Definition: costmap_2d.hpp:211
void resetMapToValue(unsigned int x0, unsigned int y0, unsigned int xn, unsigned int yn, unsigned char value)
Reset the costmap in bounds to a value.
Definition: costmap_2d.cpp:135
void resizeMap(unsigned int size_x, unsigned int size_y, double resolution, double origin_x, double origin_y)
Resize the costmap.
Definition: costmap_2d.cpp:108
unsigned char getCost(unsigned int mx, unsigned int my) const
Get the cost of a cell in the costmap.
Definition: costmap_2d.cpp:266
virtual ~Costmap2D()
Destructor.
Definition: costmap_2d.cpp:249
void polygonOutlineCells(const std::vector< MapLocation > &polygon, std::vector< MapLocation > &polygon_cells)
Get the map cells that make up the outline of a polygon.
Definition: costmap_2d.cpp:415
virtual void deleteMaps()
Deletes the costmap, static_map, and markers data structures.
Definition: costmap_2d.cpp:93
bool saveMap(std::string file_name)
Save the costmap out to a pgm file.
Definition: costmap_2d.cpp:536
bool copyWindow(const Costmap2D &source, unsigned int sx0, unsigned int sy0, unsigned int sxn, unsigned int syn, unsigned int dx0, unsigned int dy0)
Copies the (x0,y0)..(xn,yn) window from source costmap into a current costmap.
Definition: costmap_2d.cpp:187
void raytraceLine(ActionType at, unsigned int x0, unsigned int y0, unsigned int x1, unsigned int y1, unsigned int max_length=UINT_MAX, unsigned int min_length=0)
Raytrace a line and apply some action at each step.
Definition: costmap_2d.hpp:430
void worldToMapEnforceBounds(double wx, double wy, int &mx, int &my) const
Convert from world coordinates to map coordinates, constraining results to legal bounds.
Definition: costmap_2d.cpp:308
unsigned char * getCharMap() const
Will return a pointer to the underlying unsigned char array used as the costmap.
Definition: costmap_2d.cpp:261
bool worldToMap(double wx, double wy, unsigned int &mx, unsigned int &my) const
Convert from world coordinates to map coordinates.
Definition: costmap_2d.cpp:287
void copyMapRegion(data_type *source_map, unsigned int sm_lower_left_x, unsigned int sm_lower_left_y, unsigned int sm_size_x, data_type *dest_map, unsigned int dm_lower_left_x, unsigned int dm_lower_left_y, unsigned int dm_size_x, unsigned int region_size_x, unsigned int region_size_y)
Copy a region of a source map into a destination map.
Definition: costmap_2d.hpp:382
void convexFillCells(const std::vector< MapLocation > &polygon, std::vector< MapLocation > &polygon_cells)
Get the map cells that fill a convex polygon.
Definition: costmap_2d.cpp:432
double getResolution() const
Accessor for the resolution of the costmap.
Definition: costmap_2d.cpp:531
virtual void updateOrigin(double new_origin_x, double new_origin_y)
Move the origin of the costmap to a new location.... keeping data when it can.
Definition: costmap_2d.cpp:330
Costmap2D()
Default constructor.
Definition: costmap_2d.cpp:243
bool setConvexPolygonCost(const std::vector< geometry_msgs::msg::Point > &polygon, unsigned char cost_value)
Sets the cost of a convex polygon to a desired value.
Definition: costmap_2d.cpp:386
double getSizeInMetersY() const
Accessor for the y size of the costmap in meters.
Definition: costmap_2d.cpp:516
double getSizeInMetersX() const
Accessor for the x size of the costmap in meters.
Definition: costmap_2d.cpp:511
void worldToMapNoBounds(double wx, double wy, int &mx, int &my) const
Convert from world coordinates to map coordinates without checking for legal bounds.
Definition: costmap_2d.cpp:302
virtual void initMaps(unsigned int size_x, unsigned int size_y)
Initializes the costmap, static_map, and markers data structures.
Definition: costmap_2d.cpp:101
bool copyCostmapWindow(const Costmap2D &map, double win_origin_x, double win_origin_y, double win_size_x, double win_size_y)
Turn this costmap into a copy of a window of a costmap passed in.
Definition: costmap_2d.cpp:145
unsigned int getSizeInCellsX() const
Accessor for the x size of the costmap in cells.
Definition: costmap_2d.cpp:501
virtual void resetMaps()
Resets the costmap and static_map to be unknown space.
Definition: costmap_2d.cpp:124
double getOriginY() const
Accessor for the y origin of the costmap.
Definition: costmap_2d.cpp:526
unsigned int getSizeInCellsY() const
Accessor for the y size of the costmap in cells.
Definition: costmap_2d.cpp:506
double getOriginX() const
Accessor for the x origin of the costmap.
Definition: costmap_2d.cpp:521
void setCost(unsigned int mx, unsigned int my, unsigned char cost)
Set the cost of a cell in the costmap.
Definition: costmap_2d.cpp:276
unsigned int cellDistance(double world_dist)
Given distance in the world... convert it to cells.
Definition: costmap_2d.cpp:255
Costmap2D & operator=(const Costmap2D &map)
Overloaded assignment operator.
Definition: costmap_2d.cpp:210