Tag Archives: Octomap

How to create octomap tree from mesh

I was looking for a way to create an octomap tree from arbitrary mesh file. Well at first I tried to convert my data into PCL pointcloud and then convert them into an octomap tree. But the problem was, for instance when you a cuboid mesh, you only have 8 vertex, which gives you 8 point and the walls between them won’t appear in the final octomap tree. So I found the following solution:

1) First, download the latest version of binvox from  http://www.patrickmin.com/binvox/ (more about binvox, source code available here or you can try this)
2) Convert you mesh file into binvox file i.e

3) grab the binvox2bt.cpp from octomap at GitHub and compile it, then

4) visualize the bt file install octovis:

then:

mesh file (Dude.ply).

octomap bt file (Dude.binvox.bt).

The sample file can be downloaded at Dude.ply, Dude.binvox.bt.

 

Octomap explanierend

In this tutorial, I explain the concept, probabilistic sensor fusion model and the sensor model used in Octomap library.

related publication: OctoMap: An Efficient Probabilistic 3D Mapping Framework Based on Octrees

1)Octamap Volumetric Model

octree storing free (shaded white) and occupied (black) cells. Image is taken from Ref [1]


2)Probabilistic Sensor Fusion Model

3)Sensor Model for Laser Range Data

Image is taken from Ref [1].

 

Making occupancy grid map in ROS from gazebo with Octomap

Here is an example of obtaining occupancy grid from sensory data of turtlebot robot.

1.First you need to install all dependencies for gazebo and turtlebot and  octomap server:

2. Launch gazebo in a simulated environment:

3.Launch RVIZ to view the published data

3.Move your robot via keyboard:

to learn how to move the robot with your joystick controller please follow my other tutorial on that here

4. Create a txt file and save it as  octomap_turtlebot.launch. Then paste the following lines in that:

 

and call it by

5.Now in the rviz add an OccupancyMap and view the octomap. Of course, you need to remove the floor first 🙂