今天看啥  ›  专栏  ›  机器人规划与控制研究所

机器人算法——costmap膨胀层InflationLayer

机器人规划与控制研究所  · 公众号  ·  · 2023-11-28 18:52
“ 地图膨胀问题,一直在耳边听了很久,考虑自己写一个膨胀地图,故先研读思路。”01—膨胀算法如下图是更新地图膨胀代码:void InflationLayer::updateCosts(costmap_2d::Costmap2D& master_grid, int min_i, int min_j, int max_i, int max_j){ //用指针master_array指向主地图,并获取主地图的尺寸,确认seen_数组被正确设置。 boost::unique_lock lock(*inflation_access_); if (!enabled_ || (cell_inflation_radius_ == 0)) return; // make sure the inflation list is empty at the beginning of the cycle (should always be true) ROS_ASSERT_MSG(inflation_cells_.empty(), "The inflation list must be empty at the beginning of inflation"); unsigned char* master_array = master_grid.getCharMap(); unsigned int size_x = master_grid.getSizeInCellsX(), size_y = master_grid.getSizeInCellsY(); if (seen_ == NULL) { ROS_WARN("InflationLayer::updateCosts(): seen_ array is NULL"); seen_size_ = size_x * size_y; seen_ = new bool[s ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照