SLAM建图

建图路径

现在的slam建图的时候基本认为是人手动操控机器人进行建图的。

局部地图融合

根据传感器获得的对当前局部环境的地图
在这里插入图片描述
要将局部地图融入全局地图,首先得进行坐标变换,包括平移和旋转,变换到全局地图的位置。

局部地图初始时,用像素值128表示当前栅格不确定(所用像素值的范围0-255),然后,如果当前栅格是障碍,我们把它置0,否则就是255。

线性融合 :

让全局栅格地图上栅格的值分布在0-255,栅格对应的值小于128时,越小是障碍的概率越大,栅格对应的值大于128时,越大是障碍的概率越小。

融合地图:

//plocalGrid为局部栅格
//pglobleGrid为局部地图在全局地图的投影位置。
//栅格地图的像素值在0~255之间。
IF  plocalGrid == obstacle and plocalGrid -value1>=0 //局部为障碍
	Then pglobleGrid-=value1; //更新全局地图
ELSE IF plocalGrid == Passable and pglobleGrid +value2<=255 //局部为空地
	Then pglobleGrid +=value2; //更新全局地图
Endif

value1和value2是一个经验值,比如可以都取5。

贝叶斯融合 :
我们利用贝叶斯进行滤波

P ( s t a t e i ∣ Z t ) = ( 1 + ( 1 − P 0 ( s t a t e i ∣ Z t ) ) ∗ ( 1 − P ( s t a t e i ∣ Z t − 1 ) ) P 0 ( s t a t e i ∣ Z t ) ∗ P ( s t a t e i ∣ Z t − 1 ) ) − 1 P(state_i |Z_{t})=(1+\cfrac{(1-P_0(state_i |Z_{t}))*(1-P(state_i |Z_{t-1}))}{P_0(state_i |Z_{t})*P(state_i |Z_{t-1})})^{-1} P(stateiZt)=(1+P0(stateiZt)P(stateiZt1)(1P0(stateiZt))(1P(stateiZt1)))1

= P 0 ( s t a t e i ∣ Z t ) ∗ P ( s t a t e i ∣ Z t − 1 ) ( 1 − P 0 ( s t a t e i ∣ Z t ) ) ∗ ( 1 − P ( s t a t e i ∣ Z t − 1 ) ) + P 0 ( s t a t e i ∣ Z t ) ∗ P ( s t a t e i ∣ Z t − 1 ) =\cfrac{P_0(state_i |Z_{t})*P(state_i |Z_{t-1})}{(1-P_0(state_i |Z_{t}))*(1-P(state_i |Z_{t-1}))+P_0(state_i |Z_{t})*P(state_i |Z_{t-1})} =(1P0(stateiZt))(1P(stateiZt1))+P0(stateiZt)P(stateiZt1)P0(stateiZt)P(stateiZt1)

Z Z Z: 值观测值(每一次的观测值来源于局部地图,只有两种状态:占据、空闲)
P ( s t a t e i ∣ Z t ) P(state_i |Z_{t}) P(stateiZt): 融合t+1时刻的观测值后,栅格i被障碍占据的概率
P ( s t a t e i ∣ Z t ) P(state_i |Z_{t}) P(stateiZt): 融合t时刻的观测值后,栅格i被障碍占据的概率,也就是上一次观测的概率
P 0 ( s t a t e i ∣ Z t + 1 ) P_0(state_i |Z_{t+1}) P0(stateiZt+1): 单纯的从t+1时刻的观测值,判断的栅格i被障碍占据的概率,即预测概率
一般可以取常数,如 P 0 ( s t a t e i ∣ Z t = 占 据 ) = 0.6 , P 0 ( s t a t e i ∣ Z t = 空 闲 ) = 0.3 P_0(state_i |Z_{t}=占据)=0.6,P_0(state_i |Z_{t}=空闲)=0.3 P0(stateiZt=)=0.6P0(stateiZt=)=0.3

参考:二维栅格地图绘制

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值