Closed mehditlili closed 4 years ago
All the value treatment happens in the shaders.
Basically you can add a line here to do something if d
is NaN.
https://github.com/blodow/realtime_urdf_filter/blob/80473bd80406c67f9f36e0388a8de6259bdc3b49/include/shaders/urdf_filter.frag#L14-L17
The others option is to apply a filter on your depth image with : http://wiki.ros.org/image_proc
Replacing nan values with large values (eg. larger than max depth the camera can see) solved it for me. The mask then contains the robot parts that were not correctly reported before.
In my use case, some robot links are too close to the camera, resulting in nans/zeros in the depth image (min distance for the depth camera to make valid pointclouds is ~30 cm). Unfortunately the mask returned by the filter does only cover valid points. I couldn't yet figure out a way to tell the urdf_filter that zero points that land where we normally see the robot should also be accounted for in the filter. Is there any way to do that?