camera1394
camera1394 copied to clipboard
add configurable output rate, different from camera poll rate
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
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.
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
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.