ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Accessing 3D map data saved in bt file/formats to save octomap

asked 2012-06-25 09:31:54 -0600

shubh991 gravatar image

updated 2012-06-26 06:37:08 -0600

AHornung gravatar image

I have been able to build a 3D map using octomap and have saved the same as a .bt file. I have to work on a localisation algorithm which requires the coordinates of free and occupied cells(especially the boundary cells of any occupied region) of the saved map.

Is it possible to extract the information like coordinates and no. of free and occupied cells from a bt file? If yes, how? If not, then what should be the accessible file format and how should I save my map in that format?

I am using ROS electric in Ubuntu 11.10. Please help.

edit retag flag offensive close merge delete


@shubh991 How do you save the map into file when octomap_server is running?

ChickenSoup gravatar image ChickenSoup  ( 2012-07-04 21:19:13 -0600 )edit

ok found it : rosrun octomap_server octomap_saver

ChickenSoup gravatar image ChickenSoup  ( 2012-07-04 21:33:13 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-06-26 06:44:02 -0600

AHornung gravatar image

bt ("Bonsai Tree") files are a very compact binary serialized representation of OctoMap octree, and thus not directly human readable.

You can easily write a program that reads in the .bt, creates an OcTree from it and then traverse the full tree with an octree leaf_iterator to do whatever you want with the coordinates or voxels. For details see the doxygen documentation of OctoMap:

You can also have a look at the file "bt2vrml.cpp" in your octomap package. It reads in a .bt file and creates a VRML file of the occupied voxels (which will result in a quite large file).

edit flag offensive delete link more


thanx man...that seems helpful to proceed with.

shubh991 gravatar image shubh991  ( 2012-06-26 09:20:44 -0600 )edit

Question Tools


Asked: 2012-06-25 09:31:54 -0600

Seen: 2,820 times

Last updated: Jun 26 '12