ase_exploration探索建图包(基于强化学习+gmapping建图+探索算法+有需要就调用(frontier_exploration包))

1.从README.md了解输入输出以及其实现的功能

这个包的readme.md说明里写的很清楚,ase_exploration的输入是:various costmaps ;输出是:new exploration targets for the robot.它使用layers of costmaps to track free,occupied,and unknown space.基于此,采样出可能的轨迹。每条轨迹由一个粒子来进行携带。

“The ase_exploration package is a planner for robotic exploration tasks,taking as input data from various costmaps(输入:various costmaps) and outputting new exploration targets for the robot(输出:机器人新的探索任务).”

“The planner software uses layers of costmaps to track free,occupied,and unknown space(使用costmaps 层去track 空闲,占据,未知的空间).“

“Based on this information,it will sample possible trajectories (采样出可能的轨迹)and sensor readings(采样出传感器读数),and iteratively improve the trajectories to maximize the mutual information of the map and future observations.(去最大化地图与未来observation的互信息)”

2.关键参数说明,包括cfg文件夹下的参数

仔细看ase_exploration包的cfg文件夹(可以动态调节参数的)或者在ase_exploration包下的ExplorationPlannerROS文件夹的explorationPlannerROS.cpp;可以看到从README.md 第6条 Parameters(静态参数)和第7条 Parameters(动态参数)找到对应参数的含义。

1>静态参数篇

这里的参数系列有:

Frame ids:我们需要定义map frame和机器人的base frame,因为要正确表达其中的TF变换:between map_frame_id and base_frame_id;

Planner behaviour control:这里面的参数与move_base的路径规划相关参数类似。设置最小奖励,最大采样轨迹数,搜索目标执行时间,轨迹的最小规划长度等;

Robot dynamics model limits:机器人相关的参数,是线速度,角速度,到达轨迹末端的最小旋转角度和最大旋转角度;

2>动态参数篇

这里的参数是可以在该包cfg文件夹下可以找到的,运行这个包时,是可以通过外部命令调节这些参数。

rosrun rqt_reconfigure rqt_reconfigure

具体参考:

里面的参数系列:

Planning algorithm settings:规划算法相关的一些参数,比如说如何评价随机采样生成的轨迹的优劣,使用这个公式: k=a*i+b;还有指明迭代次数num_kernels,以及采样的粒子数,每一个粒子携带一条轨迹,既然涉及到粒子,重采样相关的参数resample_thresh自然也是少不了。

需要重点说明的是这个采样模型,使用的是Gaussian kernels。一开始的时候,"trajectories are sampled from a uniform distribution(均匀分布)",然后" iterations from Gaussian kernel centred(集中在) at the previous evaluated trajectories(预先评判的轨迹)"。

轨迹采样过程是通过定义Gaussian kernel的standard deviations;至于这个Gaussian kernel模型,其主要组成参数:(linear velocity线速度:std_vel),(angular velocity角速度:std_ang),(a final rotation at the end of the trajectory轨迹末端的最后的旋转角度:std_fr)".

在每一次迭代过程中,Gaussian kernel used to modify each trajectory samples from three indepent Gaussian distributions(三个独立的高斯分布)。

Planning settings and constrains:这里面有两个重要参数,其中allow_unknow_targets,控制着在不是free spaces的地方,planner是否去产生exploration tasks。将这个参数设置为false,会让整个探索变得更加保守,只会在已知free的地方去设置exploration goals。另一个参数是default_ctrl_duration,含义是每个control action的持续时间。这也决定了planner考虑的轨迹的持续时间。

Simulated laser scanner parameters:模拟激光的相关参数。因为要对observations进行采样,通过激光传感器来做。

注意这句话:"The node samples observations via raytracing with a simulated laser range finder assuming a map hypothesis consistent with the current costmaps."

以及"These observation samples are applied to evaluate the trajectories."采样出的observation,是用于评判生成轨迹的质量的。

既然是与激光有关,那就是一些常见的参数了,激光的最小incidence angle与最大incidence angle,两束激光射线之间的角度间隔,激光可测量到的最大距离,以及因为激光传感器有测量误差,我们假定两个概率:

laser_p_false_pos:probability of false positive (假阳性)reading for the laser(free cell observed as occupied:空闲的栅格被视作占据的);

laser_p_false_neg:probability of false negative(假阴性) reading for the laser(occupied cell observed as free:占据的栅格被视作空闲的);

3.什么时候调用frontier_exploration包,强化学习算法失效时,就回调经典包

至于何时调用frontier_exploration包,README.md解释,如果这个ase_exploration检测到机器人被困或者产生的局部轨迹不是很具有信息性(heuristic),那么就会调用经典的frontier-based exploration 去选择下一个探索目标,"and afterwards again resumes planning via forward simulation of local trajectories."

4.如何调用经典包:frontier_exploration

至于怎么调用这个frontier_exploration包,这里ase_exploration包是通过引用frontier_exploration包srv文件夹下的GetNextFrontier.srv,UpdateBoundaryPolygon.srv这两个服务。

而这个frontier_exploration包,除了plugin插件用于rviz显示,重要的就是costmap了。乍一看这个包,最吸引人的应该是src目录下的frontier_search.cpp里,这里主要还是搜索算法在起作用,可以在里面看到队列这些常见的数据结构。附带链接:Frontier-based exploration介绍

5.References

i)frontier_exploration包对应源码:有坑,需要自己填。其实也就是melodic版本下没有ase_exploration需要调用frontier_exploration的两个service对应的srv文件:GetNextFrontier.srv,UpdateBoundaryPolygon.srv。可以到indigo版本下把srv文件拷贝下来,添加到melodic版本里,另外对应CMakeLists.txt文件是需要修改的。

ii)frontier_exploration包对应的论文:“A Frontier-Based Approach for Autonomous Exploration”.

iii)ase_exploration包对应的源码:github.com/laurimi/ase_

iiii)ase_exploration包对应的源码的readme.md截图:

iiiii)ase_exploration包对应的论文:"Planning for robotic exploration based on forward simulation".

iiiiii)关于ase_exploration包的相关中文介绍:

6.总结

这个包综合性很强,首先gmapping建图,使用其本质--占据栅格地图构建,

然后用到了move_base包,使用其costmap--通俗就是图层,

最后用到了强化学习的本质--多个观察observations,评价函数,设置奖励,输出动作,或者输出目标。(强化学习一个示例,我的毕设作品:)

PS:ase_exploration包真是入行slam领域1年的slamer的提升的好助手!赞赞b( ̄▽ ̄)d