Open jdddog opened 9 years ago
I bet for the nested fors, especially the depth one. We should try to replace by memcpys.
But also we allocate memory for each message on every iteration, while we should do just once, as soon as we know the image/pointcloud size.
I can confirm that the problem comes from the accumulated effect of different sources:
With indigo now it's very fast.
Hey
I was timing the topics that onNewColorSample and onNewDepthSample publish to (with rostopic hz), and they publish really really slow. About 8hz on a netbook specced for a Turtlebot and even slower on an AMD gizmoboard (about 3.5hz). Both of these systems should have enough processing power to publish an image and pointcloud at 30hz, especially the netbook because heaps of people already use Kinect's with them.
I checked to see if it was a problem with the driver, but I found that its not. If you remove all of the code in onNewColorSample and onNewDepthSample and simply publish a string to a topic then the resulting hz is much higher (25 - 30hz).
Does anyone already have any ideas where the inefficiencies lie? I have voxel grid and radius based filtering off.
Thanks
Jamie