Ask Your Question

Revision history [back]

Just to clarify, you want your system to be able to save a pcd file which is a single cloud merging the point clouds from all four kinect sensors?

At the moment you're publishing 4 separate point clouds in different frames and defining a transformation tree which allows RVIZ to display them all at the same time. The point clouds are not being merged into a single cloud yet, the kinect frame is simply a node in the TF tree is not a point cloud at all.

To achieve what you want you'll need to write a node which subscribes to the four kinect point cloud topics and also sets up a transform listener to receive information about the TF tree. Then you'll need to synchronise the four incoming topics somehow, then transform the points in each point cloud so it is represented in the same frame and them to a new point cloud. You can then save this new merged point cloud to a PCD file.

This isn't the simplest thing and you'll need to get your hands dirty with python or C++ but I hope it gets you going in the right direction.

Just to clarify, you want your system to be able to save a pcd file which is a single cloud merging the point clouds from all four kinect sensors?

At the moment you're publishing 4 separate point clouds in different frames and defining a transformation tree which allows RVIZ to display them all at the same time. The point clouds are not being merged into a single cloud yet, the kinect frame is simply a node in the TF tree is not a point cloud at all.

To achieve what you want you'll need to write a node which subscribes to the four kinect point cloud topics and also sets up a transform listener to receive information about the TF tree. Then you'll need to synchronise the four incoming topics somehow, then transform the points in each point cloud so it is represented in the same frame and them to a new point cloud. You can then save this new merged point cloud to a PCD file.

This isn't the simplest thing and you'll need to get your hands dirty with python or C++ but I hope it gets you going in the right direction.

Edit: To do a quick dirty synchronisation you could store the last point clouds on each of the four topics. These point clouds would start out empty, then at the end of each callback you you check if all four of the stored point clouds contain points. This is a test to check that a cloud has been received on each topic. Then you could merge all four clouds and save, then clear the four saved clouds.

This method effectively processes the most recent four clouds that have not been processed already, and is tolerant of the clouds arriving at different rates and orders.