As a side note about the lab, the code given for lab 3 that goes through the map data and colors any cell that is occupied I would strongly recommend you to rewrite it as if you ran it you should of found there were issues with it. The map data is a 1D array that you need to search through given the width and height and you can use two for loops to easily turn it into a 2D array. For placing the points, you want to add + 0.5 * resolution to both the x and y point values instead of the offset it currently has in the code so that you put a point into the center of the cell you desire so it will light it up in RViz.
The given code has some errors. Says Eric: