博客转载自:https://blog.csdn.net/u013158492/article/details/50493113

这个类中有一个LayeredCostmap* layered_costmap_数据成员,这个数据成员很重要,因为这个类就是通过这个指针获取到的对master map的操作。没有这个指针,所有基于Layer继承下去的地图的类,都无法操作master map。 这个类基本上没有什么实质性的操作,主要是提供了统一的接口,要求子类必须实现这些方法。这样plugin使用的时候,就可以不用管具体是什么类型的map,反正都有同样的方法名。 
以下是这个类实现的两个方法,其他的方法基本上都是virtual ,要求子类实现。

void Layer::initialize(LayeredCostmap* parent, std::string name, tf::TransformListener *tf)
{
layered_costmap_ = parent;
name_ = name;
tf_ = tf;
onInitialize();
} const std::vector<geometry_msgs::Point>& Layer::getFootprint() const
{
return layered_costmap_->getFootprint();
}

重要的几个virtual方法:

 virtual void updateBounds(double robot_x, double robot_y, double robot_yaw, double* min_x, double* min_y,
double* max_x, double* max_y) {} /**
* @brief Actually update the underlying costmap, only within the bounds
* calculated during UpdateBounds().
*/
virtual void updateCosts(Costmap2D& master_grid, int min_i, int min_j, int max_i, int max_j) {} /** @brief Stop publishers. */
virtual void deactivate() {} /** @brief Restart publishers if they've been stopped. */
virtual void activate() {} virtual void reset() {}

这个类就这么多内容,接下来进入真正干活的几个类分析:

ObstacleLayer
InflationLayer
StaticLayer
VoxelLayer

  

最新文章

  1. js指定分隔符连接数组元素join()
  2. HBase change split policy on an existing table
  3. javascript的sort()方法
  4. MongoDB 索引相关知识
  5. nodePPT 这可能是迄今为止最好的网页版PPT
  6. BZOJ1507 [NOI2003]Editor
  7. Eclipse反编译工具Jad及插件JadClipse配置(转)
  8. 【C#4.0图解教程】笔记(第1章~第8章)
  9. cf591A Wizards&#39; Duel
  10. 关于Struts2的类型转换详解
  11. android连续点击两次返回键退出代码
  12. Linux 下如何安装软件?
  13. c# datatable row
  14. js随机数的取整
  15. [转]springboot2 webflux 响应式编程学习路径
  16. 使用pandas的部分问题汇总
  17. Android 音视频深入 十二 FFmpeg视频替换声音(附源码下载)
  18. Log4Cpp的使用(转)
  19. tomcat8w.exe 运行 提示 指定的服务未安装 unable to open the service &#39;tomcat8&#39;
  20. MongoDB操作数据库的几个命令(自己用)

热门文章

  1. 【解题报告】[动态规划]RQNOJ - PID72 / 拔河比赛
  2. 深入理解java虚拟机-第七章
  3. Lua学习笔记(1)
  4. Servlet概念入门
  5. 利用脚本启动java程序
  6. vim中多行注释和多行删除命令
  7. find 使用指南
  8. 【转】使用Badboy录制脚本,作为JMeter测试的素材
  9. 常用FTP命令 1. 连接ftp服务器
  10. 第15届浙江省赛 E LIS