Read-only localization mode #1643
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added new parameter:
Mem/LocalizationReadOnly(default false, like before)Current issue (s) detected by setting the database in read-only mode:
if(!databaseSaved || (!_memoryChanged && !_linksChanged && !databaseNameChanged) || this->isReadOnly())_memoryChangedis true only if we save localization data_linksChangedis true if we change labelUpdate: To work around the issues above:
Mem/LocalizationReadOnlythat is currently not compatible with memory management and multi-disjoint sessions in the database.Update 2: To add a slight precision, nodes added in localization mode are removed at the end of the same iteration, meaning that not indexed words added to dictionary are automatically removed. So when we close, the dictionary should then have exactly the same words than at the beginning of the session. To make it work with memory management, we would need to not change word refs from retrieved nodes (or just make a temporary change) when compared back to current dictionary (containing latest localization node), so that the end of the iteration, we restore back the old word refs. Playing devil advocate, retrieved words can be matched not only with new words from localization node, but also nodes from the map that were not there when these nodes were added during SLAM. It seems to me that as soon memory management is used, it is difficult to support a read-only mode at the same time.