title: How to make Occupancy grid map from laser Sensor data?
body: <p>i am doing a course project on ROS and am stuck on fairly easy task.</p>
  
  <p>My robot model has a laser scanner and I generated a bag file using my robot model in gazebo</p>
  
  <p>I am asked to generate a Occupancy grid map as we do in SLAM. I am NOT allowed to use gmapping or hector mapping so I have to write my own code.</p>
  
  <p>right now I have achieved that I initialized the map and visualized it in rviz. It is fairly simple as I just set height, width, resolution and placed all zeros in .data.</p>
  
  <p>My next task should be use the sensor data being published and generate a map. and here I am stuck as I cannot find some appropriate tutorials. However i found a good implementation of the same task but its too verbose for me to decipher. it is <a href="http://cs225turtle.googlecode.com/svn/trunk/project2/local_obstacles/src/local_obstacles.cpp" rel="nofollow">here</a></p>
  
  <p>Can you please explain where can I get some help? Or you can also help me in the answer.</p>
  
  <p>If you ask, I can paste my code also.</p>