当前位置:   article > 正文

local costmap empty using move_base_node|turtlebot_stage_the origin for the sensor at

the origin for the sensor at

local costmap empty using move_base_node|turtlebot_stage

在我运行roslaunch turtlebot_stage turtlebot_in_stage.launch时查看local_costmap时,发现地图是空的。

在这里插入图片描述

这是因为,单线激光的高度在0.4米,而costmap_common_params.yaml的所选/scan数据的高度范围在0.25-0.35之间。

在这里插入图片描述

然后,我偿试改为max_obstacle_height: 0.5#0.35,又发现如下警告:

[ WARN] [1540470442.937371426, 3.000000000]: The origin for the sensor at (2.00, 1.98, 0.40) is out of map bounds. So, the costmap cannot raytrace for it.
[ WARN] [1540470443.935926596, 4.000000000]: The origin for the sensor at (2.00, 1.98, 0.40) is out of map bounds. So, the costmap cannot raytrace for it.
[ WARN] [1540470444.935980333, 5.000000000]: The origin for the sensor at (2.00, 1.98, 0.40) is out of map bounds. So, the costmap cannot raytrace for it.
[ WARN] [1540470445.936014597, 6.000000000]: The origin for the sensor at (2.00, 1.98, 0.40) is out of map bounds. So, the costmap cannot raytrace for it.
  • 1
  • 2
  • 3
  • 4

然后就是各种搜解决方案,终于在这个问题Sensor raytrace error when maps set to voxel最后一个回答中找到了问题的产生原因。

在这里插入图片描述

答主的原话是,这是一个很蠢的问题(好吧!!!),z_voxels表示z轴的格数,如果设为2,分辨率因为是0.2,则costmap在z的范围为 [ 0 , 0.2 × 2 ] = [ 0.0 , 0.4 ] [0,0.2\times 2]=[0.0,0.4] [0,0.2×2]=[0.0,0.4],而0.4正好与警告里的值吻合。下图是官网给出的参数介绍costmap_2d/indigo/obstacles
在这里插入图片描述

而我设定的max_obstacle_height: 0.5#0.35,0.5超出了地图z的有效范围,所以才会产生警告,又由于激光的高度正好为0.4(该值可通过查看/base_laser_link/base_linktf关系得知,可调的一个值,怎么调整与本篇无关,不作介绍),所以没有考虑进地图,所以局部地图中才是空白的,其实在这套参数下,实时的激光数据对global_costmap也没起作用。只是global_costmap被全局的地图初始化后,才有一个静态的初始值。这样的costmap不具备应对环境中新出现的障碍物的能力(例如原来构建的全局地图发生改变,又例如环境中有动态障碍物等)。因此,很有必要将参数配置成功,使得costmap中能包含实时的传感器信息。

在这里插入图片描述

对原始的costmap_common_params.yaml作上图中两处改变(红框处),z_voxels: 3,这样 0.2 × 3 = 0.6 > 0.5 > 0.4 0.2\times 3 = 0.6 > 0.5>0.4 0.2×3=0.6>0.5>0.4,所以合适,该值取等于大于3的值都可以。

然后重新运行roslaunch turtlebot_stage turtlebot_in_stage.launch,然后就出现了梦寐以求的local_costmap。

在这里插入图片描述

总结

如果在知道costmap各个参数所代表的意思后,这个问题的确是一个silly question。不管怎样,现在是搞明白了各个参数的意思。该问题是由local_costmap的空白引出,其实它的解决,也意味着解决了global_costmap存在的问题(不包含实时的传感器信息)。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/煮酒与君饮/article/detail/805643
推荐阅读
相关标签
  

闽ICP备14008679号