OctoMap / octomap

An Efficient Probabilistic 3D Mapping Framework Based on Octrees. Contains the main OctoMap library, the viewer octovis, and dynamicEDT3D.
http://octomap.github.io
1.93k stars 657 forks source link

Octomap binary decoding #244

Open bomarali opened 5 years ago

bomarali commented 5 years ago

Hi all!

I have problems finding the description of the octomap binary decoding. I am working on octomap reconstruction in Unity using the ROS# framework. Currently I am decoding the octomap binary message based on the description in the original paper. I want to clarify the order of nodes in the message. The original paper states (section 4.3): "Beginning at the root node, each child that is not a leaf is recursively added to the bit stream" and there is the Figure 7 that illustrates that. Since there is only one occupied node in the entire tree I am having doubts about the branch (inner node) ordering in the bitstream. My assumption is that the order of nodes in the bitstream is: root, branches of the root, branches of branches, branches of branches of branches, etc; the bitstream is ordered by increasing order of branches. Alternatively I think that the ordering could be done by: root to leaf, back to root and to other leafs, etc. Could anyone clarify this for me please?

ahornung commented 5 years ago

The recursive binary data writing is done in the following lines: https://github.com/OctoMap/octomap/blob/23cb13f757e83e407ddb84d104fa55c057fb2c5e/octomap/include/octomap/OccupancyOcTreeBase.hxx#L1025

The ordering is in a depth-first sense due to the recursive call of writeBinaryNode(...) towards the end.

Caveats commented 4 years ago

@bomarali - Can I ask whether you managed to conclude your work getting Octomap into Unity.

We're looking at the application of an Octomap based on a sparse map - 25cm leafs into Octomap ROS. Unity side we've implemented the Octree setup and have a custom 2D map.

But we're struggling a little bit on taking the ROS Octovis work into Unity. Any help would be appreicated,

eric-schleicher commented 4 years ago

I'm trying to write an importer for a threejs scene to import a binary octomap and rendering it with instanced cube meshes. If any are known method to interact with octomaps from javascript... please comment .

Caveats commented 4 years ago

No but would love to hear how your planning to do this? We have a ros bridge link into unity. Which is not simple but def doable. Good luck and let us know how you get on.