# Limit the size of the octomap coming from RTABMap?

Hello,

Ideally we would like to limit the size of the octomap coming from RTABMap such that it stays within a certain size (or takes a certain amount of time to update). The parameter Rtabmap/TimeThr seems to do what we are looking for in RTABMap Viz, but is it possible to only publish the octomap correlated to what we see in the visualizer? (e.g., only publish an octomap from the "working memory")

Thank you!

edit retag close merge delete

Sort by » oldest newest most voted

I see two options:

1. Set Rtabmap/MemoryThr to a fixed number. This will limit the size of the working memory. When the OctoMap needs to be re-updated (e..g, because of a loop closure), it will use only nodes in the working memory, thus limiting its maximum update time.
2. The problem with the first approach is that loop closure detection may suffer as there will be less nodes in the working directory. If you are looking on limiting OctoMap maximum update time, you could just set the parameter GridGlobal/MaxNodes to a maximum nodes allowed to be assembled in the OctoMap. When there is no map optimisation or the map correction error of nodes fall under GridGlobal/UpdateError threshold, the OctoMap can still grow over GridGlobal/MaxNodes threshold because we only append the new node to OctoMap (which is done fast). When the OctoMap will need to be fully updated, because the whole graph has been optimized after a loop closure, only the closest GridGlobal/MaxNodes nodes to latest position will be added to the new OctoMap, thus limiting the maximum OctoMap update time.

cheers,
Mathieu

more