4

i am doing a course project on ROS and am stuck on fairly easy task.

My robot model has a laser scanner and I generated a bag file using my robot model in gazebo

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.

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.

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 here

Can you please explain where can I get some help? Or you can also help me in the answer.

If you ask, I can paste my code also.

M T
  • 161
  • 1
  • 2
  • 13
  • 1
    Are you asking how to build an occupancy grid map in general (i.e. how the algorithm works) or do you know the algorithm and have problems in implementing it with ROS? – luator Nov 16 '15 at 11:24

2 Answers2

1

First, you have to differentiate between two tasks: Simulatanous Localisation and Mapping (SLAM), and Mapping with Known Poses. While in the first issue you want to solve the mapping and localization at the same time, the second one is 'just' drawing the so-called inverse sensor model into map. For both cases the book by Thrun gives good algorithms and theory to solve the issue. Anyway, have a look on Dirk Hähnel's thesis or the HEISE Bot implementation (in German) to get insights into mapping.

Tik0
  • 2,499
  • 4
  • 35
  • 50
-2

if You Solved Your Localization Problem The Rest Is more simple Than That, All You Have to do is Convert Your LaserScan Data To Occupancy_grid (in case You Use map_server) There's some Code In python in ROS Answers That Might Help You or You Can Look Into Hector_mappping or Gmapping Code To see How They are Converting Their Laser Data and adapt To Your Own Code.

EDIT 1:

Just Found GitHub Repo That Does This In C++ .

Mohammad Ali
  • 569
  • 4
  • 10