introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.6k stars 761 forks source link

Where to Integrate a body filter into custom build #1301

Open spelletier1996 opened 1 week ago

spelletier1996 commented 1 week ago

I would like to integrate a body filter into rtabmap in a custom fork, the body filter will take in the most recent point cloud frame, remove the body points and then return a filtered cloud. Ideally this would work for both the point cloud generated by a stereo camera input and the a direct scan cloud input.

Could someone point me towards were in the source this would be best implemented? Or at the very least which where the best places to get started to understand the flow data flow from input scan_cloud or stereo_images to point cloud being served to the algos for mapping.

matlabbe commented 1 week ago

If you work with depth images, you could set 0 depth to mask the body in the image, then feed that updated depth image to rtabmap instead of the original one.

For general point clouds, you may filter the point cloud first, then feed the filtered cloud to rtabmap.

For implementation, the easiest would be to create your own node to filter to mask the depth image or filter the point cloud of your lidar. From robot_description, you may get the 3D models for each TF link, then use TF to know where the 3D models are at a specific time and reproject them in camera you want to filter.

For inspiration, you may take a look at camera_self_filter, rgbd_self_filter or robot_body_filter packages. See also: