gmapping 算法解析

来源:互联网 发布:淘宝面膜便宜的原因 编辑:程序博客网 时间:2024/05/18 01:11

SLAM


slam翻译成中文叫“即时定位与地图构建”,顾名思义,该技术包含定位与建图两个方面,而且定位与建图相辅相成、互相影响。构建地图首先要知道机器人的精确位姿,精确定位又需要给定的地图做参考。
先讲已知精确位姿(坐标和朝向)的地图创建,机器人位置已知,通过激光雷达扫描到环境特征,即障碍物距离。可通过机器人坐标和朝向以及障碍物距离计算出障碍物的坐标,采用bresenham直线段扫面算法,障碍物所处的栅格标注为occupy,机器人所处的栅格与障碍物所处的栅格之间画直线,直线所到之处都为free。当然每个栅格并不是简单的非0即1,栅格的占据可用概率表示,若某一个栅格在激光束a扫描下标识为occupy,在激光束b扫描下也标识为occupy,那该栅格的占据概率就变大,反之,则变小。这样,机器人所处的环境就可以通过二维栅格地图来表征。

再讲如何在已知地图的情况下采用粒子滤波算法进行精确定位,一般包括以下几个步骤:

(1)给定初始位姿,初始化粒子群,采用高斯分布进行随机采样;

(2)根据运动模型模拟粒子运动;

(3)计算粒子评分
每个粒子的位姿即为假设的机器人位姿,采用bresenham直线段扫面算法,可计算出粒子当前位置与障碍物之间的栅格占据集合,计算出的栅格占据集合与给定的地图进行匹配计算,从而对每个粒子进行评分,选择得分高的粒子作为该时间点的机器人位姿。

(4)粒子群重采样

将评分低的粒子舍弃,将评分高且很接近的粒子都保留下来,并对评分高的粒子进行复制,保持粒子数量不变。


Rao-Blackwellized particle filer

OpenSlam_gmapping算法源自Giorgio Grisetti;Cyrill Stachniss;Wolfram Burgard;等人2007年发表的论文“Improved Techniques for Grid Mapping with Rao-Blackwellized Particle Filters”。该论文主要解决两个问题:1.粒子自适应重采样;2.考虑机器人移动和观测值的建议分布。论文的摘要引用如下:

“Recently, Rao-Blackwellized particle filters have been introduced as an effective means to solve the simultaneous localization and mapping problem. This approach uses a particle filter in which each particle carries an individual map of the environment.Accordingly, a key question is how to reduce thenumber of particles. In this paper, we present adaptive techniques for reducing this number in a Rao-Blackwellized particle filter for learning grid maps. We propose an approach to compute an accurate proposal distribution taking into account not only the movement of the robot but also the most recent observation.This drastically decreases the uncertainty about the robot’s pose in the prediction step of the filter. Furthermore, we present an approach to selectively carry out resampling operations whichseriously reduces the problem of particle depletion."


(未完待续),,