RTABMAP: Save recently added points of /cloud_map topic
I am using the RTABMAPS /voxel_cloud topic to generate a pointcloud that only contains tree trunks from a .BAG recording in a forest plot. I am only interested in points that correspond to a tree trunk, so I am forced to use points that are not yet aligned into a global cloud like the /cloud_map topic is. In other words I want to selectively add points to the cloud.
This is what my program generates using the /voxel_cloud topic
I would prefer to use points from the /cloud_map topic
I am wondering if it is possible to extract only the most recently added points to the /cloud_map topic, because the /cloud_map is more dense. If I were to use the /cloud_map topic in my program, I would be saving existing trees multiple times since the /cloud_map is aligned.
One way I have imagined is to save the cloud_map topic every time it is updated, and compare all point when it is updated to determine which ones are most recently added. This would become extremely slow with a large cloud and is probably not the best way to approach the problem.
Best Regards, Nick