[ROS学习]-map.yaml 文件内容解析

写在前面

以下内容主要来自 ROS wiki 官网 map_server:https://wiki.ros.org/map_server

一、yaml格式

image: testmap.png
resolution: 0.1
origin: [0.0, 0.0, 0.0]
occupied_thresh: 0.65
free_thresh: 0.196
negate: 0

参数解析:

  • image: 地图文件的路径,可以是绝对路径,也可以是相对路径
  • resolution: 地图的分辨率, 米/像素
  • origin: 地图左下角的 2D 位姿(x,y,yaw), 这里的yaw是逆时针方向旋转的(yaw=0 表示没有旋转)。目前系统中的很多部分会忽略yaw值。
  • occupied_thresh: 占用概率大于这个阈值的的像素,会被认为是完全占用。
  • free_thresh: 占用概率小于这个阈值的的像素,会被认为是完全自由。
  • negate: 是否颠倒 白/黑 、自由/占用 的意义(阈值的解释不受影响)

可选参数:

  • mode: 有三个值可选:trinary, scale, raw 。默认值是 trinary ,更多细节请参考下一节的 具体的解释

二、ROS wiki 原文

1.2 YAML format

The YAML format is best explained with a simple, complete example:

image: testmap.png
resolution: 0.1
origin: [0.0, 0.0, 0.0]
occupied_thresh: 0.65
free_thresh: 0.196
negate: 0
Required fields:
  • image : Path to the image file containing the occupancy data; can be absolute, or relative to the location of the YAML file

  • resolution : Resolution of the map, meters / pixel

  • origin : The 2-D pose of the lower-left pixel in the map, as (x, y, yaw), with yaw as counterclockwise rotation (yaw=0 means no rotation). Many parts of the system currently ignore yaw.

  • occupied_thresh : Pixels with occupancy probability greater than this threshold are considered completely occupied.

  • free_thresh : Pixels with occupancy probability less than this threshold are considered completely free.

  • negate : Whether the white/black free/occupied semantics should be reversed (interpretation of thresholds is unaffected)

Optional parameter:

  • mode : Can have one of three values: trinary, scale, or raw. Trinary is the default. More information on how this changes the value interpretation is in the next section.

1.3 Value Interpretation

你可能感兴趣的:(ROS学习之路)