1 概述
obstacle和voxel层包含了 PointClouds 或者 LaserScans形式的传感器消息。 障碍物层用于二维追踪,体素层用于三维追踪。
1.1 标记和清除
代价地图自动订阅传感器主题并进行相应自我更新。每个传感器既可以用于标记(插入障碍信息到代价地图),也可以用于清除(从代价地图移除障碍信息),或者两种功能都有。 如果使用的是体素层,每一列上的障碍信息需要先进行投影转化成二维之后才能放入代价地图中。
1.2 ROS API
1.2.1 订阅的主题
<point_cloud_topic> ( sensor_msgs/PointCloud)- For each "PointCloud" source listed in the observation_sources parameter list, information from that source is used to update the costmap.
- For each "PointCloud2" source listed in the observation_sources parameter list, information from that source is used to update the costmap.
- For each "LaserScan" source listed in the observation_sources parameter list, information from that source is used to update the costmap.
- The costmap has the option of being initialized from a user-generated static map (see the static_map parameter). If this option is selected, the costmap makes a service call to the map_server to obtain this map.
1.2.2 传感器管理参数
~<name>/observation_sources (string, default: "")
- 观察源列表以空格分割表示,定义了下面参数中每一个 <source_name> 命名空间
~<name>/<source_name>/topic (string, default: source_name)
- 源<source_name>的传感器数据使用的topic,Defaults to the name of the source.
- 指定传感器原点坐标系。 Leave empty to attempt to read the frame from sensor data. The frame can be read from both sensor_msgs/LaserScan, sensor_msgs/PointCloud, and sensor_msgs/PointCloud2 messages.
- 传感器读数保存多久(单位秒), A value of 0.0 will only keep the most recent reading.
- 多久读取一次传感器数据(单位秒), A value of 0.0 will allow infinite time between readings. This parameter is used as a failsafe to keep the navigation stack from commanding the robot when a sensor has failed. It should be set to a value that is slightly more permissive than the actual rate of the sensor. For example, if we expect a scan from a laser every 0.05 seconds we might set this parameter to be 0.1 seconds to give a generous buffer and account for some amount of system latency.
- 指定主题相关的数据类型, 目前可用数据类型有 "PointCloud", "PointCloud2", 和 "LaserScan"
- Whether or not this observation should be used to clear out freespace.
- Whether or not this observation should be used to mark obstacles.
- 传感器读数最大有效高度(单位米),This is usually set to be slightly higher than the height of the robot. Setting this parameter to a value greater than the global max_obstacle_height parameter has no effect. Setting this parameter to a value less than the global max_obstacle_height will filter out points from this sensor above that height.
- 传感器读数最小有效高度(单位米), This is usually set to be at ground height, but can be set higher or lower based on the noise model of your sensor.
- 指定可将多大范围空间内障碍物插入到代价地图中这个参数指定范围上限边界(单位米)
- 指定raytrace可以清除障碍物的最大范围
- Allows for Inf values in "LaserScan" observation messages. The Inf values are converted to the laser maximun range.
1.2.3 全局过滤参数
这些参数可应用于所有传感器:
~<name>/max_obstacle_height (double, default: 2.0)
- The maximum height of any obstacle to be inserted into the costmap in meters. This parameter should be set to be slightly higher than the height of your robot.
- The default maximum distance from the robot at which an obstacle will be inserted into the cost map in meters. This can be over-ridden on a per-sensor basis.
- The default range in meters at which to raytrace out obstacles from the map using sensor data. This can be over-ridden on a per-sensor basis.
1.2.4 障碍代价地图插件(ObstacleCostmapPlugin)
该参数只可用于ObstacleCostmapPlugin
~<name>/track_unknown_space (bool, default: false)
- 指定是否在代价地图中track unknown空间, unknown means that no observation about a cell has been seen from any sensor source.
1.2.5 体素代价地图插件(VoxelCostmapPlugin)
下面参数仅可用于 VoxelCostmapPlugin
- ~<name>/origin_z (double, default: 0.0)
- The z origin of the map in meters.
- The z resolution of the map in meters/cell.
- The number of voxels to in each vertical column, the height of the grid is z_resolution * z_voxels.
- The number of unknown cells allowed in a column considered to be "known"
- The maximum number of marked cells allowed in a column considered to be "free".
- Whether or not to publish the underlying voxel grid for visualization purposes.
2 观察缓冲(ObservationBuffer)
costmap_2d::ObservationBuffer 被用来吸收传感器点云,然后使用tf将它们转换到想使用的坐标系,并会一直存储直到收到这些信息被请求。大多数用户使用costmap_2d::Costmap2DROS自动创建的costmap_2d::ObservationBuffer即可满足需求,但为了某些特殊需求可能需要自己创建costmap_2d::ObservationBuffer。
2.1 API Stability
- C++ API是稳定的
2.1.1 C++ API
有关costmap_2d::ObservationBuffer类的C++文档请参考: ObservationBuffer C++ API