wavelab / ximea_ros_cam

Ximea ROS Camera
MIT License
14 stars 12 forks source link

Very slow image acquisition #37

Closed MarviB16 closed 5 years ago

MarviB16 commented 5 years ago

Hi, I set the publishing frequency to 20 Hz and the frame rate to 20 FPS, but still it publishes only about 2 images per second...

Here my .yaml file:

####################
# General Configuration Parameters Go Here!
####################

# directory to save images (make sure that directory exists and that it is an absolute path).
image_directory: "/home/mar"  # must be absolute path, not relative path (i.e. '~')

# save images to the disk
save_disk: false

# save images on trigger (calibration only)
calib_mode: false

####################
# Diagnostics Configuration Parameters Go Here!
####################

enable_diagnostics: true
data_age_max: 0.1
pub_frequency: 20.0
pub_frequency_tolerance: 1.0

####################
# Camera Configuration Parameters Go Here!
####################

# image_transport compressed image parameters
image_transport_compressed_format: "png"
image_transport_compressed_jpeg_quality: 100
image_transport_compressed_png_level: 1

# colour format
format: "XI_RGB24"

# triggering (0 - none, 1 - software trigger (NOT IMPLMENTED YET),
# 2 - hardware trigger)
cam_trigger_mode: 0
hw_trigger_edge: 0            # if hw trigger, 0/1 = rising/falling edge trigger

# for camera frame rate
frame_rate_control: true      # enable or disable frame rate control
                              # (works if no triggering is enabled)
frame_rate_set: 20            # for trigger mode, fps limiter (0 for none)
img_capture_timeout: 10000     # timeout in milliseconds for xiGetImage()

# exposure settings
auto_exposure: false          # auto exposure on or off
exposure_time: 50000           # manual exposure time in microseconds
manual_gain: 9                # manual exposure gain
auto_exposure_priority: 0.8   # auto exposure to gain ratio (1 = use only exposure)
auto_time_limit: 30000        # auto exposure time limit in microseconds
auto_gain_limit: 2.0          # auto exposure gain limit

# camera coloring
# white balance mode: 0 - none, 1 - use coefficients, 2 = auto
white_balance_mode: 0
white_balance_coef_red: 3.0   # white balance red coefficient (0 to 8)
white_balance_coef_green: 0.0 # white balance green coefficient (0 to 8)
white_balance_coef_blue: 4.0  # white balance blue coefficient (0 to 8)

# region of interest
roi_left: 0                   # top left corner in pixels
roi_top: 324
roi_width: 1280               # width height in pixels
roi_height: 700

Does anybody have an idea why it is so slow?

mpitropov commented 5 years ago

Are you able to get it working at more than 2 hz with any settings?

img_capture_timeout is in milliseconds so the timeout is 10 seconds. I would set this back to 1000 img_capture_timeout: 10000 # timeout in milliseconds for xiGetImage() I would set this to 1000 and if it works at 20 hz then increase it until it stops working. exposure_time: 50000 # manual exposure time in microseconds

MarviB16 commented 5 years ago

I tried that, but no... Even if I only use one camera.

mpitropov commented 5 years ago

Did you follow these three sections within the instructions?

mpitropov commented 5 years ago

What is the poll_time_frame value in your launch file? 0.5 will be 2 hz <param name="poll_time_frame" type="double" value="0.5"/>

MarviB16 commented 5 years ago

Hi, I followed the instructions. But yes my poll_time_frame is 0.5, I will try it out tomorrow, and then I will report back. That should be the issue, thanks!

carloswanguw commented 5 years ago

Try setting it to be something that is higher than your desired rate. So if you want to do 20hz, and so you want to poll well above this rate to have a finer time resolution.

I would say polling every 1ms is fine (so 0.001), so you get images at 20hz and should be off (at least from the software side) by around 1-2ms from the 50ms window between images.

MarviB16 commented 5 years ago

Works thanks!