Blog Post #1 (SLAM) - ksoltan/comprobo_final GitHub Wiki

Project Blog Post #1: Nov. 30

Mapping

Our first goal in the project is to gain a deeper understanding of Simultaneous Localization And Mapping (SLAM) Algorithms, modify the code to better interface with the planning portion of our project, and if time permits, attempt to gradually build our own implementation of a SLAM Algorithm.

There are various different SLAM implementations, but the one we started with was GMapping, due to its ease of use and implementation as a "black box." Although this may seem contrary to our original plans, it is still very accessible for further study. We began by simply implementing GMapping through a pre-made ROS node and generating maps. After generating said maps, we decided to look at the map data in order to determine the data structure for better parsing during the planning phase.

We found that GMapping saves the data as two different files - one is an image file with the map, marked in either gray, black, or white depending on if the area is unknown, solid, or free to move through, respectively. The other file is a .yaml file with header information such as resolution.

Unsatisfied with the need to constantly save the map data and read it due to the resources and time involved, we decided to instead try and capture the direct measured map data. Fortunately the GMapping page provided information on the internal map data structure. Combined with insights from looking over the mapping source code, we were able to simply implement a callback function that would receive the intermediary map data, and then subsequently unpack it. The map was stored as an occupancy grid, starting from [0,0] as the origin and building an arbitrary size map based on the resolution parameter. In the map, -1 denoted an unknown/unmapped pixel, 0 denoted space that was free to move, and 100 denoted occupied space. Thus, we were able to modify our subscriber function to unpack the map data to send to the planner.