本文主要是介绍ROS naviagtion analysis: costmap_2d--Costmap2D,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Costmap2D是存储地图数据的父类。真正的地图数据就存储在数据成员unsigned char *costmap_ 。
首先,分析类的构造函数:
默认构造函数:Costmap2D::Costmap2D() :
// just initialize everything to NULL by default
Costmap2D::Costmap2D() :size_x_(0), size_y_(0), resolution_(0.0), origin_x_(0.0), origin_y_(0.0), costmap_(NULL)
{access_ = new mutex_t();
}
带参数的构造函数:Costmap2D::Costmap2D(unsigned int cells_size_x, unsigned int cells_size_y, double resolution, double origin_x, double origin_y, unsigned char default_value)
Costmap2D::Costmap2D(unsigned int cells_size_x, unsigned int cells_size_y, double resolution,double origin_x, double origin_y, unsigned char default_value) :size_x_(cells_size_x), size_y_(cells_size_y), resolution_(resolution), origin_x_(origin_x),origin_y_(origin_y), costmap_(NULL), default_value_(default_value)
{access_ = new mutex_t();// create the costmapinitMaps(size_x_, size_y_);resetMaps();
}
Copy 构造函数:Costmap2D::Costmap2D(const Costmap2D& map)
Costmap2D::Costmap2D(const Costmap2D& map) :costmap_(NULL)
{access_ = new mutex_t();*this
这篇关于ROS naviagtion analysis: costmap_2d--Costmap2D的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!