rtabmap_ros icon indicating copy to clipboard operation
rtabmap_ros copied to clipboard

Remove free cells beyond walls

Open derektan95 opened this issue 1 year ago • 8 comments

Hi Rtabmap community,

I would like to repost this question from the Rtabmap Forum to seek some advice from a wider community.

I am using gazebo simulation with rtabmap, along with a 3D lidar for localization and mapping. I noticed some free cells that is often mapped beyond the walls in my simulation, as seen below. Is there a way to modify certain params such that there's no free cells behind the walls (I understand that this isn't realistic in the real world)?

image

This is an example of no free cells beyond obstacles: image

Warm Regards, Derek Tan

derektan95 avatar Jul 26 '23 02:07 derektan95

Hi,

Is the second figure created with Cartographer?

What are the Grid/**** parameters that you used for rtabmap? To know in particular if that 2D occupancy grid map is created from OctoMap projection or from the 2D ray tracing approach. If you can share the database, that would be nice.

cheers, Mathieu

matlabbe avatar Jul 30 '23 23:07 matlabbe

Hi @matlabbe,

The second figure is taken from the internet as an example, but I have tried cartographer in the past to get a clean map like this earlier on.

As for the Grid parameters, I have tried to create both 2D occupancy grid map from octomap projection, and from the 2D ray tracing approach. Both have issues where free cells exist beyond walls. Nevertheless, I will upload the rtabmap database files for both Grid/3D=True and Grid/3D=False very soon.

Warm Regards, Derek Tan

derektan95 avatar Jul 31 '23 18:07 derektan95

Hi @matlabbe,

Here are the database files you have requested for. This folder contains 2 db files where Grid/3D=True and Grid/3D=False. As you will see, there are white cells beyond the walls.

Db Files: https://drive.google.com/drive/folders/1oCluv92DReBZqwBDLn7GPfS57FBwLFaY?usp=sharing

Thanks again, Derek Tan

derektan95 avatar Aug 01 '23 15:08 derektan95

2D (rtabmap ray tracing): Screenshot from 2023-08-05 16-24-14

3D (octomap ray tracing): Screenshot from 2023-08-05 16-25-55

In both cases, the ray tracing seems overshooting a little, maybe because of angle resolution. For rtabmap ray tracing, this is used here for each obstacle.

matlabbe avatar Aug 05 '23 23:08 matlabbe

Hi Mathieu,

Thanks for the feedback! Any suggestions on how I can reduce this overshoot? Is increasing the angle resolution a good idea (i.e. lower magnitude)?

It seems like the problem is increasingly worsened for rays hitting walls that are further away from the robot.

Warm Regards, Derek

derektan95 avatar Aug 06 '23 02:08 derektan95

The farther it is, the more accurate the slope computation should be. Don't know if using double instead of float in that function could help for ray tracing on far obstacles. Other option would be to stop ray tracing free space 1 cell before the actual obstacle cell.

matlabbe avatar Aug 06 '23 22:08 matlabbe

Hi Mathieu,

I tried stopping ray tracing of free space 1 cell before the actual obstacle, at the proposed code location here. However, I realized this technique only works on my 2D occupancy grid map only if I set Grid/3D=false. This does not work if octomap is activated. May I know how I can implement this feature for octomap raytracing?

derektan95 avatar Sep 01 '23 08:09 derektan95

The ray tracibg for the 3d case is done by the OctoMap library. You may do a similar hack in their code.

matlabbe avatar Sep 03 '23 04:09 matlabbe