Creating 2D Occupancy Grid Map

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating 2D Occupancy Grid Map

Raf1000
Hi there,

I'm new to robotics and currently working on a project to build a water sprinkler robot for backyard use. I'm using RTAB-Map to record my environment using the iPhone app, and I want to generate a 2D occupancy grid map from those recordings. The goal is to create a map where I can set waypoints for my robot to follow as part of its SLAM-based navigation.

However, I've hit a roadblock. In the RTAB-Map desktop application, the option to generate an occupancy grid appears to be grayed out, and despite searching online, I haven’t found any alternative methods that work with the mobile-recorded data. I’m stuck trying to convert the RTAB-Map data from the iPhone into a usable 2D map for path planning.

Any help or guidance on how to solve this would be greatly appreciated!
Reply | Threaded
Open this post in threaded view
|

Re: Creating 2D Occupancy Grid Map

matlabbe
Administrator
It is possible to generate a 2D occupancy grid from iPhone data. We don't generate the occupancy grid by default with the iPhone app, so you need to open the database in rtabmap-databaseViewer, set these parameters (in Core Parameters view) and click on Edit->"Regenerate all local grids..."

We set MaxGroundHeight to -1 because the z=0 with the iPhone is the height at which we start scanning, which usually around 1.5 meters above the ground (setting to -1 here means the ground is expected to be below 50 cm assuming the scan started at 1.5 meters).




Example of scan taken with iPad:


However, even if you can get a nice 2D occupancy grid, the major roadblock you will get next is how the robot can localize on that map. You didn't specify what sensors the robot is using, but if it is 2D lidar based, maybe you could use the 2D map and AMCL to localize. If it is camera-based, it won't work using visual localization, because the point of view would be very likely different than the one during the scan with the phone. Faking a laser scan with the camera could be possible, similarly to this example, but use AMCL instead of rtabmap, though it is a long-shot.

cheers,
Mathieu