2021SC@SDUSC
1. 本周工作目标
这周继续阅读navigation仓库里的代码。结合实际情况,本周的工作目标如下:
-
阅读amcl包裹的文档和源码,明白这个包裹的作用
2. 阅读amcl包裹的文档和源码
再次找到官方wiki:
由文档得知,amcl包裹是通过自适应蒙特卡罗粒子定位方法,来在地图中定位机器人位置的一个包。
那么,这个包裹具体的结构是怎样的呢?先看目录结构:
andy@virtual-machine:~/navigation/amcl$ tree . . ├── cfg │ └── AMCL.cfg ├── CHANGELOG.rst ├── CMakeLists.txt ├── examples │ ├── amcl_diff.launch │ └── amcl_omni.launch ├── include │ └── amcl │ ├── map │ │ └── map.h │ ├── pf │ │ ├── eig3.h │ │ ├── pf.h │ │ ├── pf_kdtree.h │ │ ├── pf_pdf.h │ │ └── pf_vector.h │ └── sensors │ ├── amcl_laser.h │ ├── amcl_odom.h │ └── amcl_sensor.h ├── package.xml ├── src │ ├── amcl │ │ ├── map │ │ │ ├── map.c │ │ │ ├── map_cspace.cpp │ │ │ ├── map_draw.c │ │ │ ├── map_range.c │ │ │ └── map_store.c │ │ ├── pf │ │ │ ├── eig3.c │ │ │ ├── pf.c │ │ │ ├── pf_draw.c │ │ │ ├── pf_kdtree.c │ │ │ ├── pf_pdf.c │ │ │ └── pf_vector.c │ │ └── sensors │ │ ├── amcl_laser.cpp │ │ ├── amcl_odom.cpp │ │ └── amcl_sensor.cpp │ ├── amcl_node.cpp │ └── include │ └── portable_utils.hpp └── test ├── basic_localization.py ├── basic_localization_stage.xml ├── global_localization_stage.xml ├── rosie_multilaser.xml ├── set_initial_pose_delayed.xml ├── set_initial_pose.xml ├── set_pose.py ├── small_loop_crazy_driving_prg_corrected.xml ├── small_loop_crazy_driving_prg.xml ├── small_loop_prf.xml ├── texas_greenroom_loop_corrected.xml ├── texas_greenroom_loop.xml ├── texas_willow_hallway_loop_corrected.xml └── texas_willow_hallway_loop.xml 14 directories, 45 files
可以看见文件目录也是比较复杂。
我们打开来阅读具体的源码:
可以看见在namespace amcl
里定义了一些传感器,这些就是用来修正粒子分布的信源。
继续阅读:
可以看到这里就是粒子算法的核心实现。美中不足的是,这段代码偏向于算法理论,比较多直接使用的模型假设,不太能直接读懂,需要进一步学习书籍/论文文献,来弄懂。
3. 总结
以上就是amcl包裹的作用和源码分析。