Hi,
There is a relatively large topic in SLAM about filtering dynamic objects. For example, you can look at our paper "
Dynamic Object Tracking and Masking for Visual SLAM", in which we used an image segmentation approach to remove people from the map. Basically, in rtabmap, if you set depth pixels to 0 in the depth image for some objects (e.g., people), the resulting 3D point cloud won't have them. It is kind of an easy way to do it without modifying any rtabmap code: just create a new node republishing a depth image without dynamic objects.
For the OctoMap approach, it will eventually remove all dynamic objects but the camera/lidar should be able to ray trace in them when the object is gone, so the background should be seen by the sensor. Note also that if the robot was moving at the same time, it may add dynamic obstacles that some part of them are now outside the FOV of the sensor, so part of the object will stay there unless the robot back up to clear everything. See also this thread:
http://official-rtab-map-forum.206.s1.nabble.com/How-does-rtabmap-deal-with-dynamic-objects-tp4735p8255.htmlcheers,
Mathieu