MCPcopy Create free account
hub / github.com/RoboMaster/RoboRTS / Enqueue

Method Enqueue

roborts_costmap/src/inflation_layer.cpp:250–263  ·  view source on GitHub ↗

* @brief Given an index of a cell in the costmap, place it into a list pending for obstacle inflation * @param grid The costmap * @param index The index of the cell * @param mx The x coordinate of the cell (can be computed from the index, but saves time to store it) * @param my The y coordinate of the cell (can be computed from the index, but saves time to store it) * @param src_x The x

Source from the content-addressed store, hash-verified

248 * @param src_y The y index of the obstacle point inflation started at
249 */
250inline void InflationLayer::Enqueue(unsigned int index, unsigned int mx, unsigned int my,
251 unsigned int src_x, unsigned int src_y) {
252 if (!seen_[index]) {
253 // we compute our distance table one cell further than the inflation radius dictates so we can make the check below
254 double distance = DistanceLookup(mx, my, src_x, src_y);
255
256 // we only want to put the cell in the list if it is within the inflation radius of the obstacle point
257 if (distance > cell_inflation_radius_)
258 return;
259
260 // push the cell data onto the inflation list and mark
261 inflation_cells_[distance].push_back(CellData(index, mx, my, src_x, src_y));
262 }
263}
264
265void InflationLayer::ComputeCaches() {
266 if (cell_inflation_radius_ == 0)

Callers

nothing calls this directly

Calls 1

CellDataClass · 0.50

Tested by

no test coverage detected