• Diff for "octomap/Tutorials/Creating an OctoMap from existing 3D (mesh) data"
Differences between revisions 2 and 3
Revision 2 as of 2011-08-24 14:14:31
Size: 1006
Editor: ArminHornung
Comment:
Revision 3 as of 2011-08-24 14:34:23
Size: 2787
Editor: ArminHornung
Comment:
Deletions are marked like this. Additions are marked like this.
Line 28: Line 28:
With the help of the tool [[http://www.cs.princeton.edu/~min/binvox/|binvox]] (distributed in OctoMap for convenience) and binvox2bt, you can create a volumetrict 3D occupancy map (as octree) from existing mesh data (e.g. collada, 3ds, VRML, ...).
Line 29: Line 30:
=== Converting to a binvox-compatible format ===
VRML97 (2.0) data seems to work best in binvox. If your data is already in that format (and metric), skip forward. E.g. Google Sketchup is not able to export into a working VRML 2.0 file (the units are all in inch). This, and wrong normals often cause problems in voxelization.

A useful workflow is to export to a 3DS file as intermediate first. Then, import that 3DS file into Blender (be sure to disable the scaling option at the import!). Export to VRML97 from there (be sure to delete the little cube blender adds by default).

=== Voxelizing VRML97 in binvox ===
Run binvox on the exported VRML file. Recommended options:
 * -e exact carving gives best results, but results e.g. in hollow walls (no room for compression in the octree)
 * otherwise try a combination of -c and / or -v. This might or might not work for some meshes
 * -fit gives the smallest bounding box fit
 * -d <numvoxels>: Number of voxels for the longest cube dimension. You need to tweak this number so that the final map (after octree creation) has the desired resolution.

The result is a ".binvox" file.

=== Converting a binvox file to an OcTree ===
With binvox2bt you can create a binary (occupied / free, remainder is unknown) octree. The option --mark-free will mark all freespace, otherwise it's "unknown". binvox2bt will also output the smallest voxel resolution, so you might have to go back to the previous step to adjust <numvoxels>. Verify the resulting .bt file in octovis.

Note: This is only a rough outline at the moment.
(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Creating an OctoMap from existing 3D (mesh) data

Description:

Tutorial Level: INTERMEDIATE

With the help of the tool binvox (distributed in OctoMap for convenience) and binvox2bt, you can create a volumetrict 3D occupancy map (as octree) from existing mesh data (e.g. collada, 3ds, VRML, ...).

Converting to a binvox-compatible format

VRML97 (2.0) data seems to work best in binvox. If your data is already in that format (and metric), skip forward. E.g. Google Sketchup is not able to export into a working VRML 2.0 file (the units are all in inch). This, and wrong normals often cause problems in voxelization.

A useful workflow is to export to a 3DS file as intermediate first. Then, import that 3DS file into Blender (be sure to disable the scaling option at the import!). Export to VRML97 from there (be sure to delete the little cube blender adds by default).

Voxelizing VRML97 in binvox

Run binvox on the exported VRML file. Recommended options:

  • -e exact carving gives best results, but results e.g. in hollow walls (no room for compression in the octree)
  • otherwise try a combination of -c and / or -v. This might or might not work for some meshes
  • -fit gives the smallest bounding box fit
  • -d <numvoxels>: Number of voxels for the longest cube dimension. You need to tweak this number so that the final map (after octree creation) has the desired resolution.

The result is a ".binvox" file.

Converting a binvox file to an OcTree

With binvox2bt you can create a binary (occupied / free, remainder is unknown) octree. The option --mark-free will mark all freespace, otherwise it's "unknown". binvox2bt will also output the smallest voxel resolution, so you might have to go back to the previous step to adjust <numvoxels>. Verify the resulting .bt file in octovis.

Wiki: octomap/Tutorials/Creating an OctoMap from existing 3D (mesh) data (last edited 2013-01-18 15:38:39 by ArminHornung)