ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Merge two OccupancyGridMaps

asked 2012-03-05 10:17:28 -0500

tiko gravatar image

updated 2014-01-28 17:11:34 -0500

ngrennan gravatar image

Hi there,

as the topic says: I want to merge/combine two OccupancyGridMaps.

The conditions: I recieve two messages (nav_msgs/OccupancyGrid) by two services. These two maps have the same resolution, but different postions and size (orientation can be omitted).

My question: Is there an easy way to combine/overlay these maps and build a new map out of these? Or do I have to do this the hard way?

Kind regards, tiko

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-03-06 04:11:49 -0500

bhaskara gravatar image

updated 2012-03-06 04:12:32 -0500

The occupancy_grid_utils package ( provides a "union of grids" operation.

edit flag offensive delete link more

answered 2012-03-05 11:01:28 -0500

Mac gravatar image

My advice: convert them to images, work as images, and then convert back. That is, build an OpenCV 8-bit unsigned image for each map, then rotate and translate one appropriately, and then add them together in image space, and switch back to an OccupancyGrid.

edit flag offensive delete link more

Question Tools


Asked: 2012-03-05 10:17:28 -0500

Seen: 2,326 times

Last updated: Mar 06 '12