2d Map Editor in database viewer save issue

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

2d Map Editor in database viewer save issue

derektan1995
Hi Mathieu,

I recently came across some issues with editing the 2d gridmap in the database viewer. I noticed that there is a functionality for us to edit our 2d gridmap after mapping the environment using a 2d lidar, using the 'edit optimized graph' button in the toolbar. I made used of the GUI to add / remove unknown, free and occupied cell, and after I clicked 'save', the changes to the gridmap did not persist. As a result, I was unable to export the new map or use it for localization. Are there any workarounds for this?

I am currently on the latest version of RTABmap, built from source, on my Ubuntu 18.04.

Thanks,
Derek
Reply | Threaded
Open this post in threaded view
|

Re: 2d Map Editor in database viewer save issue

matlabbe
Administrator
Hi Derek,

When fixing a bug by this commit, it also wrongly re-forced to re-optimize the graph when the optimized graph was smaller than nodes in Working Memory. The problem should be fixed by this commit.


EDIT:
For reference, when this message is shown, the map is re-assembled (the new commit above fix this one):
[ WARN] (2021-02-12 18:06:46.811) Memory.cpp:2087::loadOptimizedPoses() Optimized poses (190) and working memory size (191) don't match. Returning empty optimized poses to force re-update. If you want to use the saved optimized poses, set Mem/InitWMWithAllNodes to true

Thx for reporting!
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: 2d Map Editor in database viewer save issue

derektan1995
This post was updated on .
Hi Mathieu,

Thanks for the reply. It is strange but I am still getting the same problem, even though I have pulled and recompiled the latest version from the git repository. My approach was following your recommendations in this post.

This was after my attempt to clean up the map ('edit optimized graph'):



However, after clicking on 'save', and 'regenerate optimized graph', and saving the changes to the database. I ran the rtabmap localization while opening up this edited database. I still get a 2d map that is the unedited version:



I am really unsure why this is the case. Any insights?

Thanks,
Derek
Reply | Threaded
Open this post in threaded view
|

Re: 2d Map Editor in database viewer save issue

derektan1995
EDIT: It turns out that the issue lies with using an old database recorded a few months ago and using it with the most recent RTABMap package. The issue is fixed when I performed a remap of the environment. From my observation, older database recorded can no longer be used with the newest changes introduced to the RTABMap package.

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

Re: 2d Map Editor in database viewer save issue

matlabbe
Administrator
Hi,

Old maps would still be working, but I added new checks to re-optimize the map if the nodes in the map and nodes in Working Memory (WM) differ (to avoid some others issues). When creating the map from DatabaseViewer, it would use all nodes in the graph. If memory management is enabled, on runtime the map may not match the WM, so the map has to be regenerated. If you built the map with memory management, then created the map in DatabaseViewer, you should disable memory management parameters (Rtabmap/TimeThr=0, Rtabmap/MemoryThr = 0) and set Mem/InitWMWithAllNodes to make sure all nodes in the optimized map are in WM on localization mode.

Another tip: instead of remapping the area again to upgrade to latest rtabmap version, we can upgrade an old database to a new version with:
rtabmap-reprocess --Db/TargetVersion "" --Rtabmap/MemoryThr 0 --Rtabmap/TimeThr 0 old_map.db new_map.db

cheers,
Mathieu

Small test with this demo (I've written TURTLEBOT3 with DbViewer map editor, then reloaded in localization mode):

Reply | Threaded
Open this post in threaded view
|

Re: 2d Map Editor in database viewer save issue

derektan1995
Hi Mathieu,

I will try this out. Thanks for replying!

Much Thanks,
Derek