post-processing: manually add obstacles to map

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

post-processing: manually add obstacles to map

dschnabel
I created a map of a place that has a few glass corners, glass doors and glass walls which didn't get detected by my depth camera. So rtabmap didn't mark the space occupied.

Is there a way to manually add obstacles? I want to add this corner (green) to the occupancy map:


I was hoping to do that with the databaseViewer since there are the options "regenerate optimized 2D map" and "edit optimized 2D map". But when I edit the map this way, then it doesn't save the change to the map, at least not that I can see it in RViz.
Reply | Threaded
Open this post in threaded view
|

Re: post-processing: manually add obstacles to map

matlabbe
Administrator
Hi,

When editing the 2D map in DatabaseViewer, the resulting edited map will be available only in localization mode afterwards in rtabmap_ros. If you restart in SLAM mode, the map will be regenerated.

Here is an example with this demo. Make a map:
roslaunch rtabmap_ros demo_robot_mapping.launch rviz:=true rtabmapviz:=false
rosbag play --clock demo_mapping.bag
Close rtabmap and open the database in rtabmap-databaseViewer:
rtabmap-databaseViewer ~/.ros/rtabmap.db
Do File->Edit optimized 2D map... and add obstacles (here I've written "OBSTACLE" in the editor). Close and say No for the question about cropping all scans. Close databaseViewer and relaunch in localization mode:
roslaunch rtabmap_ros demo_robot_mapping.launch rviz:=true rtabmapviz:=false localization:=true
rosbag play --clock demo_mapping.bag


Regards,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: post-processing: manually add obstacles to map

dschnabel
Mathieu, that worked. Thank you!

Is there a way to zoom in while editing the optimized 2D map? If the map is big then it's difficult to make detailed edits without zooming in on a section. In the Graph view I can zoom in/out with the mouse wheel but that doesn't work in the edit window.
Reply | Threaded
Open this post in threaded view
|

Re: post-processing: manually add obstacles to map

matlabbe
Administrator
Hi,

We can resize the window to scale the image. However, if the map is really big, it also scales down, so the cells may indeed appear less than 1 pixel. I don't use a QGraphicsView for this, so I cannot easily add scrolling bars. A workaround is to do Export optimized 2D map... to a pgm, edit in GIMP or any image editors (where you can zoom as you wish), save, then back in DatabaseViewer, do Import optimized 2D map...

Regards,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: post-processing: manually add obstacles to map

dschnabel
I see. Exporting, editing in GIMP and re-importing in DatabaseViewer is a perfectly acceptable procedure. Thanks for pointing that out.