ros-drivers / camera1394

ROS driver for devices supporting the IEEE 1394 Digital Camera (IIDC) protocol.
http://www.ros.org/wiki/camera1394
17 stars 35 forks source link

add configurable output rate, different from camera poll rate #52

Open chataign opened 8 years ago

chataign commented 8 years ago

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

jack-oquin commented 8 years ago

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.

chataign commented 8 years ago

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

jack-oquin commented 8 years ago

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.