2D激光SLAM::ROS-AMCL包源码阅读(二)关于map地图的数据结构

ROS-AMCL包源码阅读(二)关于map地图的数据结构


map.h的内容描述如下


 map_t:地图结构体

// Description for a map
typedef struct
{
  // Map origin; the map is a viewport onto a conceptual larger map.
  //地图的原点,这个原点指中心点,即地图坐标(width/2,height/2)对应的世界坐标
  double origin_x, origin_y;
  
  // Map scale (m/cell)
  //尺度
  double scale;

  // Map dimensions (number of cells)
  //尺寸
  int size_x, size_y;
  
  // The map data, stored as a grid
  //地图的栅格描述结构体
  map_cell_t *cells;

  // Max distance at which we care about obstacles, for constructing
  // likelihood field
  //传感器可以感知的最远距离?
  double max_occ_dist;
  
} map_t;

 map_cell_t:描述地图栅格的结构体

// Description for a single map cell.
typedef struct
{
  // Occupancy state (-1 = free, 0 = unknown, +1 = occ)
  //栅格占据状态
  int occ_state;

  // Distance to the nearest occupied cell
  //该栅格距离最近一个“障碍物”(或者说距离最近的处于"占用”状态的栅格)的距离
  double occ_dist;

  // Wifi levels
  //int wifi_levels[MAP_WIFI_MAX_LEVELS];

} map_cell_t;

 

 

你可能感兴趣的:(2D激光SLAM)