0
$\begingroup$

Rosanswers logo

Hi, I am trying to build occupancy grid map in ros using laser data but have no idea from where to start. I dont want to use completely self built package as I am not allowed to use gmapping or hecor. Can anyone please point me in the right direction.


Originally posted by ZainMehdi on ROS Answers with karma: 225 on 2017-03-12

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

It seems to me that a good place to start is to look at the occupancy grid map message from the nav_msgs package http://docs.ros.org/api/nav_msgs/html/msg/OccupancyGrid.html

Also look at the laser scan message from sensor_msgs http://docs.ros.org/api/sensor_msgs/html/msg/LaserScan.html

To visualize it you will probably want to use rviz with the map display type http://wiki.ros.org/rviz/DisplayTypes/Map

Now assuming you have a stream of LaserScan messages you just need to figure out the math to map each ray to a grid cell. To do this you need to know the pose of the laser scanner. You will have to translate the ray direction from the laser scanners coordinate frame to the world coordinate frame. The tf package might help with that http://wiki.ros.org/tf

The hard part will be to handle noise and to properly merge together multiple laser scans over time to get a good probabilistic map.


Originally posted by gudjon with karma: 111 on 2017-03-12

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$
0
$\begingroup$

Rosanswers logo

Hi! Please take a look at how I built an OccupancyGrid from odometry and ultrasonic range data at this repo: https://github.com/RiccardoGiubilato/ros_autonomous_car


Originally posted by RiccardoGiubilato with karma: 76 on 2017-10-21

This answer was NOT ACCEPTED on the original site

Post score: 3


Original comments

Comment by ZainMehdi on 2017-10-23:
thanks. I will have a look :)

Comment by MsMimi on 2019-05-21:
Hello! Thanks for ur sharing.. may i know what do u mean by pure mapping instead of SLAM in your laser-to-occupancy-grid.py ? Thanks in advance!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.