-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get Neighbour-Nodes from a node #42
Comments
It's not implemented right now, the nodes have no information about their direct neighbors. What you can do is get the node's key (from iterator), then search for that key +/-1 in each dimension. |
Hi Armin,
However, I would prefer to use references to parent nodes. I extended the createChild(int) method in the By the way! This is a superior framework! Works on windows and linux. (even gs 4.7 :) ) |
The straighforward way would be:
See my comments in your pull request for the parent pointers. |
An alternative way would be to temporarily store parent information in a recursive call while the tree is traversed, and use that for faster neighbor queries. Some experimental work in that direction was started in the OcTreeLUT classes (unfinished / unused right now). |
Oh thank you! Edit: Sorry for the last message. I found this paper, which is referenced by the OcTreeLUT : http://www.cs.umd.edu/~hjs/pubs/SameCG89.pdf |
Have a look at coordToKey, the keys are a simple discretization of the coordinates. So +1 on the first dimension will be +res in x. |
Does this also apply to keys of nodes in coarser resolution? Is +1 still +res (getResolution()) or +res in this depth of the tree? |
Keys only represent the coordinates at the tree resolution (voxel coordinates). With a depth and the function |
I am facing similar issue. I am feeding Octomap::PointCloud. by using iterator I found the octreeNode of each occupied node. But How to find keys of each occupied node from OctreeNode ? |
Once upon a time there was OcTreeLUT that implemented a lookup table to compute keys of neighbor cells directly. |
Is it possible to get neighbouring nodes from a node?
I would like to use the leaf_iterator (or tree_iterator) and to extract the information from the neighbours of every node.
Thank you!
The text was updated successfully, but these errors were encountered: