Robotics StackExchange | Archived questions

How does rtabmap handle free space in an octomap?

Hello,

I am using the octomaps generated from rtabmap. Ideally in our application we would like all of the unknown space to be marked as free. It seems like the octomaps generated by rtabmap only include the obstacles and ground. Is it possible to mark unknown space to be free? I see the parameter "gridunknownspace" but that sounds like it is only for the gridmaps. It also sounds like there is some ability for ray tracing but is that only possible when using a laser scanner or 2D map? Ideally, we need a octomapmsgs/Octomap that's 3D (or 2D) with free space marked as unknown generated by a depth camera (such as the realsense D435i).

Thank you!

Asked by cad on 2019-10-01 13:42:19 UTC

Comments

Answers

When Grid/RayTracing is enabled, the free space will be tracked in the OctoMap.

Example with robot mapping demo:

$ roslaunch rtabmap_ros demo_robot_mapping.launch rviz:=true

In rtabmapviz, open Preferences->Local Occupancy Grid, then check "From Depth" (Grid/FromDepth) and "Ray Tracing" (Grid/RayTracing). Start the demo bag:

rosbag play --clock demo_mapping.bag

Obstacles: image description

Empty space: image description

cheers,
Mathieu

Asked by matlabbe on 2019-10-01 14:34:29 UTC

Comments

Thank you for your response! I tried replicating what you expressed running the demo_robot_mapping launch file, changing the parameters, and then running the bag. I can see in the 2D map that ray tracing is working, but when I try to view the free voxels in rviz nothing shows up. I can however view the occupied voxels and when I select "All Voxels" it is the same as "Occupied Voxels". Any idea what I might be missing?

Asked by cad on 2019-10-01 17:51:56 UTC

Which ROS and rtabmap version are you using?

Asked by matlabbe on 2019-10-01 18:33:25 UTC

ROS Kinetic and Rtabmap 0.19.4. It turns out that even though I cannot visualize the free voxels in RVIZ they are there and the ray tracing is working! Thank you for your help! I exported the octomap and visualized it in octovis and can see the free voxels there. Any ideas why I wouldn't be able to see that in RVIZ? I also have a problem with RVIZ where there are vertical stripes through the 2D map. They are evenly spaced in sets of 8-9 in clusters across the map with the majority of the map being fine.

Asked by cad on 2019-10-01 18:52:01 UTC

Build the octomap_rviz_plugins package from source, you will be able to see the free space in rviz. Not sure why we cannot show the colors anymore though, I'll take a look. For the stripes, it is because sometimes the center of the voxels in OctoMap don't match the center of the cells in the 2D grid when we assemble the local occupancy grids into the global one, like more on the edge of the cells, so depending on the floating precision, the points may fall on one or the other side of the edge, creating empty lines.

Asked by matlabbe on 2019-10-01 20:31:48 UTC