map
/map
消息类型
rostopic type /map_metadata
nav_msgs/MapMetaData
rostopic type /map
nav_msgs/OccupancyGrid
/map
rosmsg show nav_msgs/OccupancyGrid
std_msgs/Header header
uint32 seq
time stamp
string frame_id
nav_msgs/MapMetaData info
time map_load_time
float32 resolution
uint32 width
uint32 height
geometry_msgs/Pose origin
geometry_msgs/Point position
float64 x
float64 y
float64 z
geometry_msgs/Quaternion orientation
float64 x
float64 y
float64 z
float64 w
int8[] data
/map_metadata
rosmsg show nav_msgs/MapMetaData
WARNING: Package name "LaserUndistortion" does not follow the naming conventions. It should start with a lower case letter and only contain lower case letters, digits, underscores, and dashes.
time map_load_time
float32 resolution
uint32 width
uint32 height
geometry_msgs/Pose origin
geometry_msgs/Point position
float64 x
float64 y
float64 z
geometry_msgs/Quaternion orientation
float64 x
float64 y
float64 z
float64 w
map.yaml
image: testmap.png # 名字非常重要,这就是为什么要加载yaml,而不是pgm
resolution: 0.1 #meter per pixel
origin: [0.0, 0.0, 0.0] #left down corner pos in map frame, just a translate
occupied_thresh: 0.65 #占用概率最小值
free_thresh: 0.196 #不被占用概率最大值
negate: 0 #黑白语义反转,没用,一般为0
shangetu vs data[]
robot-coordinates-in-map
-----
test
pixel value vs cost
常规pgm 使用灰度图像;0: black; 255: white
占用概率计算: occ = (255 - pixel_value)/ 255
值域范围【0,100】
occ > occupied_thresh -> 占用
occ < fresh_thresh -> 不占用
map_server 初始化地图后,只有3个值Trinary
占用 | 100 |
---|---|
不占用 | 0 |
unknow | -1 |
staic_map 生成costmap
等级 | cost | 意义 |
---|---|---|
lethal | 254 | 碰撞,基于碰撞和内切为肯定碰撞区间 |
inscribed | 253 | 内切值,基于内切-外切区间为可能碰撞区 |
circumscriber | 128 | 外切值,基于外切区间为非碰撞区 |
lowest non-free cost | 1 | 1-127, 虽然认为非碰撞区间,但是cost代表了一定的可能性,距离障碍物越远,值越小 |
freespace | 0 | 0, 代表完整意义上free, 距离外切圆一个膨胀半径后,cost=0 |
unknown | -1 | 未知区域,默认-1 |
对于膨胀层,有几个参数很重要
参数 | 含义 |
---|---|
robot_radius | 关系到内切半径和外切半径 |
footpring | 同上,alternative parameters |
cost_scaling_factor | 关系到内切到膨胀半径的decay |
inflation_radius | 同上 |