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

rtabmap_ros octomap message without ground?

asked 2019-09-19 18:02:28 -0500

cad gravatar image


I would like to take advantage of RTABMap's native ground segmentation, but need an octomap_msgs/Octomap out. Is there a way to get the /rtabmap/octomap_obstacles as an octomap message (it is currently sensor_msgs/PointCloud2)? I tried adding "--Grid/GroundIsObstacle false" in rtabmap_args, hoping this would remove the ground from /rtabmap/octomap_binary which is already octomap_msgs/Octomap, but it did not. Is there any other way to get an octomap message map without the ground?

Thank you!

edit retag flag offensive close merge delete


I don't know much about either of those projects, but removing the ground should be trivial. In your loop when you're processing this data, just look at the Z value and if its below or really close to 0, throw it out.

stevemacenski gravatar image stevemacenski  ( 2019-09-20 14:36:12 -0500 )edit

Thank you for your suggestion. RTABMap is natively doing ground segmentation by normal filtering such that it ends up more complicated than slicing the map with a flat plane and that is what I'm hoping to leverage.

cad gravatar image cad  ( 2019-09-24 09:08:04 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-09-22 17:10:35 -0500

matlabbe gravatar image

Hi, you would have to change the code. You may try to change this line to "if(false)" to avoid adding an occupied cell for the ground, or change true to false on this line.


edit flag offensive delete link more


That's great, thank you! The coordinate system of the octomap is still the map frame, right? Is it possible to publish a 2D map with the obstacles projected down (like /rtabmap/octomap_grid) as a octomap_msgs/Octomap type or would be be more complicated to convert between?

cad gravatar image cad  ( 2019-09-24 09:05:00 -0500 )edit

Yes the octomap frame_id is the map frame. rtabmap keeps only the OctoMap in 3D, when it comes to project it in 2D for octomap_grid, it is done on the fly by iterating through the 3D OctoMap. You may be able to do what you want with the modified octomap message above (with only obstacles).

matlabbe gravatar image matlabbe  ( 2019-09-24 17:52:24 -0500 )edit

Thank you!

cad gravatar image cad  ( 2019-09-26 19:35:03 -0500 )edit

Question Tools


Asked: 2019-09-19 17:50:54 -0500

Seen: 372 times

Last updated: Sep 22 '19