camera1394 icon indicating copy to clipboard operation
camera1394 copied to clipboard

add configurable output rate, different from camera poll rate

Open chataign opened this issue 8 years ago • 3 comments

Added output_rate_hz parameter to control the output rate (ie. images processed and published) vs the camera poll rate (frame_rate). On most cameras the poll rate indirectly controls device properties such as exposure and affects the imagery. This change allows users to downsample the publication rate without affecting the quality of the imagery.

output_rate_hz=0 disables the feature

chataign avatar May 18 '16 09:05 chataign

I'd be grateful if you'd copy the indentation style of the rest of the file, when making modifications.

No particular style is better than any other, but consistency is good for readability.

jack-oquin avatar May 21 '16 22:05 jack-oquin

Hi, I just fixed the indents and cleaned up the code I added. Let me know if you have any issues reviewing this code.

While looking at the code I noticed that a new image message (sensor_msgs::Image) is instantiated at each call to poll(), which means that the image buffer will be reallocated for every single frame. This seems quite inefficient given that the image dimensions only change occasionally, and so the memory could be reused. Is this a known issue or could I look into it?

Regards, Francois

chataign avatar May 23 '16 13:05 chataign

If I remember correctly, the reason is that the Image message gets passed to ROS on the publish() call, which takes ownership the message. After that, the driver is not supposed to modify it.

jack-oquin avatar May 23 '16 15:05 jack-oquin