Robotics StackExchange | Archived questions

rtabmap_ros octomap message without ground?

Hello,

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

Thank you!

Asked by cad on 2019-09-19 17:50:54 UTC

Comments

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.

Asked by stevemacenski on 2019-09-20 14:36:12 UTC

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.

Asked by cad on 2019-09-24 09:08:04 UTC

Answers

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.

cheers,
Mathieu

Asked by matlabbe on 2019-09-22 17:10:35 UTC

Comments

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?

Asked by cad on 2019-09-24 09:05:00 UTC

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).

Asked by matlabbe on 2019-09-24 17:52:24 UTC

Thank you!

Asked by cad on 2019-09-26 19:35:03 UTC