Rosanswers logo

I'm trying to use an RGBD camera (I'm using gazebo_plugins gazebo_ros_openni_kinect plugin in simulation with gazebo 1.9.1) with the VoxelLayer.

The problem I'm facing is basically that the voxel_grid (I visualize it on rviz) is not cleared when the readings are further than the max range; there's no point to raytrace and clear them. I'm thinking of publishing some sort of a max_range point cloud only for clearing.

However, I'm curious about how people manage to solve this problem.

FYI, I'm using branch/tag 1.11.8 and I've seen a few changes you've introduced up to 1.11.11. Are they bug fixes? Or can I live without them?

This videos tries to show the issue: http://youtu.be/Pz0osmz-G24?t=26s If it's not clear enough, please tell me and I'll create another one. This is the video description (copy&paste): In this video I show two "experiments". First, I move the table close to the wall, and the voxel grid (in red) is cleared after removing the table. Second, I move the table again closer to the robot (far from the wall), and now there are voxels not cleared after removing the table. I think this could be because there is no point to clear the elements on the costmap.

Note that the gazebo_ros_openni_kinect plugin uses the depth image to generate the point cloud. And the depth image is generated using raytracing in gazebo (AFAIK). This means that when the ray doesn't hit anything the pixel is black (0); the same as if the distance were 0 (close). Therefore, for these points there's no clearing.

Trying to look for a workaround I've modified the plugin here: https://github.com/pal-robotics/gazebo_ros_pkgs/pull/2 I'm using a simulation similar to REEM's for testing.

Originally posted by Enrique on ROS Answers with karma: 834 on 2014-09-02

Post score: 0


1 Answer 1


Rosanswers logo

To me, this seems like a gazebo problem. Based on your visualization, it doesn't look like the rays that don't hit anything generate points. Without passing that information along to the voxelmap somehow, its impossible for it to clear the voxels.

(If they're being generated and they're just really close to the kinect, maybe that can be handled)

Originally posted by David Lu with karma: 10932 on 2014-09-03

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by jorge on 2014-09-04:
Are you using the laser_scan generated by depthimage_to_laserscan or directly the pointcloud? In the first case, beams not hitting are nan, and in the second, points are 0, 0, 0, I think. So yes, cannot clear with that. Maybe depthimage_to_laserscan should return +inf when the depth image contains 0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.