How to access a lower resolution (coarser) octomap (for DynamicEDTOctomap use)?

516 views
Skip to first unread message

augusto toso

unread,
May 10, 2016, 11:38:40 AM5/10/16
to OctoMap developers and users discussion
I am using DynamicEDTOctomap to generate a distance map (for later doing a SLAM).
But this processes is taking too long, so I thought: let's try lowering the input Octomap resolution.

I first try lowering in the Octomap_server (where I am keeping/updating the tree). That works well, and really speeds up the process.
BUT, I don't really want to lower the whole tree resolution, I just want a temporary coarser map to do the SLAM.

I tried appling setResolution on the Octomap but the final result is not the same (as changing directly).

Am I doing this wrong? Is it a better method to access lower resolution maps?
On the description of octomap it says that is a "multi-level" but I don't know how to access them...

Thank you for reading :)

Armin Hornung

unread,
May 12, 2016, 4:21:53 PM5/12/16
to oct...@googlegroups.com
Am 10.05.2016 um 17:38 schrieb augusto toso:
> I am using DynamicEDTOctomap to generate a distance map (for later
> doing a SLAM).
> But this processes is taking too long, so I thought: let's try
> lowering the input Octomap resolution.
>
> I first try lowering in the Octomap_server (where I am
> keeping/updating the tree). That works well, and really speeds up the
> process.
> BUT, I don't really want to lower the whole tree resolution, I just
> want a temporary coarser map to do the SLAM.
>
> I tried appling setResolution on the Octomap but the final result is
> not the same (as changing directly).

Changing the resolution of an existing map does not do anything useful,
it won't preserve your map geometry.

While building the map the inner nodes are updated to contain the
coarser resolution view. So all you need to do is perform queries e.g.
using the leaf nodes iterator with a limited depth parameter. octovis,
for example, uses this method to create coarser views on the fly.

Best regards,
Armin

augusto toso

unread,
May 26, 2016, 4:51:53 AM5/26/16
to OctoMap developers and users discussion
Thank you for the answer. :)

Although I don't see how I can create a new coarse tree from the iterator. I need a full tree since that is the main argument for the DynamicEDTOctoma. I cannot "query my way into" the function. I could iterate all the nodes (with the proper depth) and create a new tree, but that sounds even more time consuming. 

Christoph Sprunk

unread,
May 26, 2016, 5:06:07 AM5/26/16
to oct...@googlegroups.com
Hi Augusto,

There might be a nice solution for you.

DynamicEDTOctomap uses such an iterator to initialize itself from the
octree. See the function initializeOcTree in dynamicEDTOctomap.cpp, line
99. This iterator has an optional argument that dynamicEDTOctomap does
not expose so far.

-> Try adding the depth to the "octree->begin_leafs_bbx(bbxMin,bbxMax)"
in that line, that should work for you.

-> If it works well, we can expose that parameter to the constructor of
DynamicEDTOctomap.

Best,
Christoph
> --
> You received this message because you are subscribed to the Google
> Groups "OctoMap developers and users discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to octomap+u...@googlegroups.com
> <mailto:octomap+u...@googlegroups.com>.
> To post to this group, send email to oct...@googlegroups.com
> <mailto:oct...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/octomap.
> For more options, visit https://groups.google.com/d/optout.

Christoph Sprunk

unread,
May 26, 2016, 5:16:00 AM5/26/16
to oct...@googlegroups.com
Hi Augusto,

My response was a bit too quick. My suggestion will only change how the
map looks like, of course. If your goal is to lower the resolution of
the resulting distance transform (and thereby computational load), this
will not be enough, sorry. DynamicEDTOctomap internally works with the
resolution of the octree, adapting this requires a lot more changes.

For now, you will need to generate a coarser copy of the octree.

Best,
Christoph

augusto toso

unread,
May 27, 2016, 10:55:51 AM5/27/16
to OctoMap developers and users discussion
Thank you anyway,

In the end, I am using a lower resolution map in real time, and saving a graph file to plot in a higher resolution later.
Reply all
Reply to author
Forward
0 new messages