OctoMap / octomap_mapping

ROS stack for mapping with OctoMap, contains octomap_server package
http://www.ros.org/wiki/octomap_mapping
335 stars 280 forks source link

/octomap_point_cloud_centers topic is not clear when there is a loop closure in rtabmap_ros #65

Open acpl00 opened 4 years ago

acpl00 commented 4 years ago

Dear people

I have a launch file that contains the following two packages, among others:

rtabmap.launch

octomap_server with cloud_in = /rtabmap/cloud_map

I do have a problem, when I run the rtabmap.launch and I plot the /octomap_point_cloud_centers in RVIZ.

The problem is that when the rtabmap finds a loop closure and corrects itself, the /octomap_point_cloud_centers topic do not clear.

How can I solve this issue?

Any help is appreciated, thank you

wxmerkt commented 4 years ago

Hi! Sorry I am not familiar with the particular launch file, rtabmap, or how it uses the octomap package or which node thereof. You should be able to make a service call to reset the octomap which potentially would clear the point cloud?

acpl00 commented 4 years ago

Hi, I have called the reset service call, and indeed in resets the cloud_map, but it does not reset or clear the /octomap_point_cloud_centers. And when there is a rtabmap_ros loop closure the /octomap_point_cloud_centers does not clear and the resulting map is a combination of the corrected map due to the loop closure and the not corrected one.

If you do not mind you can take a look at the post I have made in rtabmap forum:

http://official-rtab-map-forum.67519.x6.nabble.com/Rtabmap-octree-centers-remain-after-loop-closure-dtected-td6470.html#a6482

wxmerkt commented 4 years ago

Sorry I do not have the capacity or time to provide support to user questions. Based on checking the source code, publishAll should be called so the point cloud should be published (publishPointCloud=true) with an empty point cloud message. Did you check that there is nothing when you listen to the topic upon a reset?

acpl00 commented 4 years ago

I have tried the reset call service and the the /occupied_cells_vis_array is reset, however the /octomap_point_cloud_centers is not reset.

wxmerkt commented 4 years ago

You may have to work with the source code and check that topics are published on reset (publishAll) and what those messages contain (e.g. rostopic echo)

wxmerkt commented 3 years ago

Related to #85 - also due to the early return inside publishAll in https://github.com/OctoMap/octomap_mapping/blob/84633da1077335e86f41fe214085d90dc212fcd8/octomap_server/src/OctomapServer.cpp#L487-L490

However, not yet fixed by #92