cartographer_ros
cartographer_ros copied to clipboard
Get a 2d occupancy grid out of a 3d pbstream
Hi everybody,
I'm trying to perform planning and navigation on an autonomous robot using the position provided by Cartographer with its 3d localization.
As a first step I'm working on planning on Occupancy Grids, and for this reason I am trying to get an occupancy grid out of Cartographer's 3D map (I have both pbstreams and bags).
I have tried the following ways:
- using "cartographer_pbstream_to_ros_map" to generate pgm + yaml: this is the fastest way, but unfortunately it gives back just the same visualization you get on rviz, which is unusable for planning purposes.
- using asset_writer to generate a probability grid: this way gives back a very clean map, which is perfect for my purposes. Unfortunately it seems that asset_writer does not keep the original dimensions of the map (it looks "zoomed in"). For this reason, when I plot the obtained map on rviz, it doesn't superimpose properly on the one used for localization, thus giving problems when I plan on the one taken from asset_writer and use the position given from the localization.
- I've also thought about generating both the 3d and 2d maps out of the bag, and using the first to localize and the second to get the occupancy grid. The problem here is that, as the loop closure is generally different between 2d and 3d mapping, I can't get two identical maps and then I can't trust my planning when the localization is performed on a different map.
Are there any other ways to do what I'm trying to do? Is there a "correct" way of translating 3d maps into occupancy grid? Is there anyone who has succeeded in using cartographer 3d for planning and navigation?
Thanks in advance for your time!
Francesco