ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A
Ask Your Question

Augmenting Octomap nodes with additional info

asked 2011-05-31 12:01:42 -0500

I'm interested in doing the following things with Octomap. I'm not sure whether they can be accomplished by using the templated classes, or by rewriting the Octomap source. What is the best solution, and which parts of the code do I need to look into?

  1. Adding additional information to the nodes in the Octomap tree - for example, color.

  2. Being able to query the value at different resolution levels. So I'd need a function which returns which returns the mean (or mode, or min/max etc) of the value from all the children nodes.

  3. Visualizing the voxels based on their value - preferably in rviz

Thanks for the help!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-06-01 01:19:09 -0500

AHornung gravatar image
  1. Because both the octrees and nodes are templated, that should be really easy to do as dornhege wrote. You would need to derive your own OcTreeNode (for data) and OcTree (for implementation). In the last versions, we moved more and more of the actual occupancy implementation into OccupancyOcTreeBase, so you can directly derive from that. For examples, have a look at the OcTreeNodeStamped and OcTreeStamped.

  2. See the answer by dornhege. For that to work with the max depth, you would need to keep the inner tree values consistent with the max or mean of their children, as it's done in OcTreeNode after each update.

  3. Check octomap_server in octomap_mapping, it sends out a visualization as MarkerArray for RViz that you can easily adapt to your needs. It's not the most efficient way to display all the voxels in RViz (and they're not shaded properly), so for much data you might need to extend our own viewer octovis to your needs.

edit flag offensive delete link more

answered 2011-05-31 23:16:58 -0500

dornhege gravatar image

Note: I didn't look in the current version's source. For the 0.8 I am working with:

  1. You probably need to write your own code (given you want occupany mapping) as the default OcTreeNode is already a OcTreeDataNote<float>. It is quite simple though, as you can just derive the classes and make sure the new node class is instantiated in the tree.

  2. That's definitely possible as you pass a max_depth to the querying function and then the inner node's value will be returned.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

The deadline to submit a proposal to present at ROSCon 2017 is June 25, 2017. Submit yours now!

Question Tools


Asked: 2011-05-31 12:01:42 -0500

Seen: 573 times

Last updated: Jun 01 '11