ROS Navigation-----costmap_2d之obstacle层简介

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.
<point_cloud2_topic> ( sensor_msgs/PointCloud2)
  • For each "PointCloud2" source listed in the observation_sources parameter list, information from that source is used to update the costmap.
<laser_scan_topic> ( sensor_msgs/LaserScan)
  • For each "LaserScan" source listed in the observation_sources parameter list, information from that source is used to update the costmap.
"map" ( nav_msgs/OccupancyGrid)
  • 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.
~<name>/<source_name>/sensor_frame ( string, default: "")
  • 指定传感器原点坐标系。 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.
~<name>/<source_name>/observation_persistence ( double, default: 0.0)
  • 传感器读数保存多久(单位秒), A value of 0.0 will only keep the most recent reading.
~<name>/<source_name>/expected_update_rate ( double, default: 0.0)
  • 多久读取一次传感器数据(单位秒), 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.
~<name>/<source_name>/data_type ( string, default: "PointCloud")
  • 指定主题相关的数据类型, 目前可用数据类型有 "PointCloud", "PointCloud2", "LaserScan"
~<name>/<source_name>/clearing ( bool, default: false)
  • Whether or not this observation should be used to clear out freespace.
~<name>/<source_name>/marking ( bool, default: true)
  • Whether or not this observation should be used to mark obstacles.
~<name>/<source_name>/max_obstacle_height ( double, default: 2.0)
  • 传感器读数最大有效高度(单位米),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.
~<name>/<source_name>/min_obstacle_height ( double, default: 0.0)
  • 传感器读数最小有效高度(单位米), This is usually set to be at ground height, but can be set higher or lower based on the noise model of your sensor.
~<name>/<source_name>/obstacle_range ( double, default: 2.5)
  • 指定可将多大范围空间内障碍物插入到代价地图中这个参数指定范围上限边界(单位米)
~<name>/<source_name>/raytrace_range ( double, default: 3.0)
  • 指定raytrace可以清除障碍物的最大范围
~<name>/<source_name>/inf_is_valid ( bool, default: false)
  • 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.
~<name>/obstacle_range ( double, default: 2.5)
  • 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.
~<name>/raytrace_range ( double, default: 3.0)
  • 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.
    ~<name>/z_resolution (double, default: 0.2)
    • The z resolution of the map in meters/cell.
    ~<name>/z_voxels (int, default: 10)
    • The number of voxels to in each vertical column, the height of the grid is z_resolution * z_voxels.
    ~<name>/unknown_threshold (int, default: ~<name>/z_voxels)
    • The number of unknown cells allowed in a column considered to be "known"
    ~<name>/mark_threshold (int, default: 0)
    • The maximum number of marked cells allowed in a column considered to be "free".
    ~<name>/publish_voxel_map (bool, default: false)
    • 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


  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值