Robotics StackExchange | Archived questions

costmap2d voxel layer doesn't clear?

Hi everyone,

I am using a PointCloud2 source for my costmap2D. I have done extra filtering to remove the ground from the estimate. I am seeing the voxel layer "hold on to" points and not clearing them despite it not seeing anything in that area. If my research is correct I see that to clear a voxel it must see a point through that point? Since I have removed the ground can I just have the costmap trust the estimate more? Essentially I just want my Pointcloud squished into a 2D costmap for movebase, I don't want the voxel layer to remember things and think it's smart.

Thanks :)

Asked by PG_GrantDare on 2019-11-26 01:01:04 UTC

Comments

Make sure clearing is enabled in observation_sources under the obstacles_layer and that your raytrace_range is greater then the obstacle_range. Ground removal should not affect the clearing of obstacles in the costmap

Asked by pavel92 on 2019-11-26 04:20:02 UTC

@pavel92 clearing is enabled, raytrace is set to 80 whilst obstacle is 20 (max dist of 100m). I believe the problem comes from that the voxel layer must see another point beyond the voxel in the same beam (projecting xyz with angle). I would like it to just clear if it can't see a point in that area?

Asked by PG_GrantDare on 2019-11-26 18:34:45 UTC

Answers

Ok, I see. The problem is that some obstacles are not cleared even though they are removed. There is a obstacle height threshold and if the obstacle was detected within this threshold and then was removed, the beams probably hit something (a wall in the background) and therefore are not considered for clearing.

There are few workarounds. First you can try reducing your raytrace range to something close but still greater then the obstacle range (for example if obstacle range is 20, set raytrace to 25-30).
Also, you can try adding the sensor in observation sources twice but this time disable marking and keep clearing enabled. In this case you will have 2 observation sources where one does marking and clearing and the other one does just clearing and you can tinker with the parameters.

There was also an issue on this problem and a commit that fixes the obstacle height calculation.

Asked by pavel92 on 2019-11-27 03:42:33 UTC

Comments