Ask Your Question
4

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

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

shubh991 gravatar image

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

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

Comments

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

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

ok found it : rosrun octomap_server octomap_saver map.bt

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

1 Answer

Sort by ยป oldest newest most voted
3

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

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: http://octomap.sourceforge.net/doxygen/index.html

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

Comments

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

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

Your Answer

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

Add Answer

Question Tools

Stats

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

Seen: 1,741 times

Last updated: Jun 26 '12