Skip to content

Issue with deleteNode when deleting all nodes #307

Open
@marcelino-pensa

Description

@marcelino-pensa

I have implemented a procedure for a fading memory octomap, meaning that it will forget things that it saw very long ago by deleting those nodes using deleteNode.
If I end up deleting all nodes from the octree, I noticed that the root node remains alive, and that the octree is saying that my whole volume is occupied.
After I delete all nodes from the octree, only one node remains, and that one is the one whose size is equal to tree.getResolution() * pow(2.0, 16.0) (i.e., the root). This node cannot be deleted, as deleteNodeRecurs does not delete a node if node != this->root.

My questions are:

  • Is there any reason why my octomap reverts back to the root as I delete all nodes? Is this the expected behavior? Why not deleting the root as well? Maybe it can't delete the root because deleteNodeRecurs does not delete the root...
  • Why can't we delete the root in deleteNodeRecurs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions