astuff / avt_vimba_camera

ROS1/2 Driver for AVT cameras using VIMBA SDK.
Other
22 stars 43 forks source link

Black&White image on USB Alvium camera #105

Closed MatCapLynx closed 1 year ago

MatCapLynx commented 1 year ago

I'm using an Alvium 1800 U-158c USB camera with ROS noetic and Vimba SDK 6. Everything is working perfectly with Vimba Viewer. I could'nt get it to work with this repo so I used this fork that I encountered on this issue. With this fork I got an image but it's only B&W and there is some weird squares on it: image Maybe the weird squares just come from rviz vizualisation as they move when resizing the window.

I've checked all the parameters and they are the same than the ones used in Vimba Viewer. Does anyone have any idea from what this could be coming from ?

Another stange thing is that after stopping to use the camera for a few weeks, I tried again with this repo and everything worked with a color image. It even worked perfectly with Mkarasneh's fork. Unfortunately after unpluging and pluging the camera everything was back to what it was before (B&W image). Now I'm stucked with it and I would appreciate any help. Thanks!

Here is my output when launching the node :

SUMMARY
========

PARAMETERS
 * /camera/AcquisitionFrameRateEnable: 1
 * /camera/AutoModeRegionHeight: 860
 * /camera/AutoModeRegionOffsetX: 152
 * /camera/AutoModeRegionOffsetY: 114
 * /camera/AutoModeRegionSelector: AutoModeRegion1
 * /camera/AutoModeRegionWidth: 1152
 * /camera/GainSelector: All
 * /camera/Intensity_Target: 43
 * /camera/SensorBitDepth: Adaptive
 * /camera/acquisition_mode: Continuous
 * /camera/acquisition_rate: 30
 * /camera/balance_ratio_blue: 1.85
 * /camera/balance_ratio_red: 1.79
 * /camera/balance_ratio_selector_blue: Blue
 * /camera/balance_ratio_selector_red: Red
 * /camera/binning_x: 1
 * /camera/binning_y: 1
 * /camera/camera_info_url: file:///home/math...
 * /camera/decimation_x: 1
 * /camera/decimation_y: 1
 * /camera/exposure: 5000
 * /camera/exposure_auto: Continuous
 * /camera/exposure_auto_alg: FitRange
 * /camera/exposure_auto_max: 9000006
 * /camera/exposure_auto_min: 167
 * /camera/exposure_auto_outliers: 50000
 * /camera/exposure_auto_rate: 50000
 * /camera/exposure_auto_target: 50000
 * /camera/exposure_auto_tol: 5
 * /camera/frame_id: camera
 * /camera/gain: 0
 * /camera/gain_auto: Continuous
 * /camera/gain_auto_adjust_tol: 5
 * /camera/gain_auto_max: 24
 * /camera/gain_auto_min: 0
 * /camera/gain_auto_outliers: 0
 * /camera/gain_auto_rate: 50
 * /camera/gain_auto_target: 50
 * /camera/guid: DEV_1AB22C008940
 * /camera/height: 1088
 * /camera/ip: 
 * /camera/iris_auto_target: 50
 * /camera/iris_mode: Continuous
 * /camera/iris_video_level_max: 110
 * /camera/iris_video_level_min: 110
 * /camera/line_mode: Input
 * /camera/line_selector: Line0
 * /camera/offset_x: 0
 * /camera/offset_y: 0
 * /camera/pixel_format: BayerRG8
 * /camera/print_all_features: False
 * /camera/ptp_mode: Off
 * /camera/stream_bytes_per_second: 450000000
 * /camera/sync_in_selector: SyncIn1
 * /camera/sync_out_polarity: Normal
 * /camera/sync_out_selector: SyncOut1
 * /camera/sync_out_source: GPO
 * /camera/trigger_activation: RisingEdge
 * /camera/trigger_delay: 0.0
 * /camera/trigger_mode: Off
 * /camera/trigger_selector: FrameStart
 * /camera/trigger_source: Software
 * /camera/use_measurement_time: False
 * /camera/whitebalance_auto: Continuous
 * /camera/whitebalance_auto_rate: 100
 * /camera/whitebalance_auto_tol: 5
 * /camera/width: 1456
 * /rosdistro: noetic
 * /rosversion: 1.15.14

NODES
  /
    camera (avt_vimba_camera/mono_camera_node)
    rviz (rviz/rviz)

auto-starting new master
process[master]: started with pid [129590]
ROS_MASTER_URI=http://192.168.5.11:11311

setting /run_id to 2b8038a6-35b0-11ed-b0a0-3fc1f679eaff
process[rosout-1]: started with pid [129616]
started core service [/rosout]
process[camera-2]: started with pid [129625]
process[rviz-3]: started with pid [129626]
[ INFO] [1663326628.628833627]: [Vimba System]: AVT Vimba System initialized successfully
[ INFO] [1663326628.630025959]: Searching for cameras ...
[ INFO] [1663326628.630518996]: Found camera named Allied Vision 1800 U-158c:
[ INFO] [1663326628.630544764]:  - Model Name     : 1800 U-158c
[ INFO] [1663326628.630554653]:  - Camera ID      : DEV_1AB22C008940
[ INFO] [1663326628.630563449]:  - Serial Number  : 00R40
[ INFO] [1663326628.630575422]:  - Interface ID   : VimbaUSBInterface_0x0
[ INFO] [1663326628.630584188]:  - Interface type : USB
[ INFO] [1663326628.630592694]:  - Access type    : Read and write access
[ INFO] [1663326628.731545146]: Trying to open camera by ID: DEV_1AB22C008940
[ INFO] [1663326631.471830910]: Opened connection to camera named Allied Vision 1800 U-158c with ID DEV_1AB22C008940
[ INFO] [1663326633.473892469]: Updating Exposure config:
[ WARN] [1663326633.476155464]:  - Tried to set ExposureTime to 5000 but the camera used 5010.63 instead
[ INFO] [1663326633.477659051]:  - ExposureAuto set to Continuous
[ INFO] [1663326633.479551539]:  - ExposureActiveMode set to FlashWindow
[ INFO] [1663326633.481893703]:  - ExposureMode set to Timed
[ INFO] [1663326633.484200069]:  - ExposureAutoMax set to 9.00001e+06
[ INFO] [1663326633.486249363]:  - ExposureAutoMin set to 167
[ INFO] [1663326633.488287615]:  - IntensityControllerTarget set to 43
[ INFO] [1663326633.490282526]:  - AutoModeRegionWidth set to 1152
[ INFO] [1663326633.492172009]:  - AutoModeRegionHeight set to 860
[ INFO] [1663326633.494142774]:  - AutoModeRegionOffsetX set to 152
[ INFO] [1663326633.496482763]:  - AutoModeRegionOffsetY set to 114
[ INFO] [1663326633.496846517]:  - AutoModeRegionSelector set to AutoModeRegion1
[ INFO] [1663326633.496885971]: Updating Gain config:
[ INFO] [1663326633.499098111]:  - Gain set to 0
[ INFO] [1663326633.500164215]:  - GainAuto set to Continuous
[ INFO] [1663326633.501194472]:  - GainAutoMax set to 24
[ INFO] [1663326633.502083754]:  - GainAutoMin set to 0
[ INFO] [1663326633.502270876]:  - GainSelector set to All
[ INFO] [1663326633.502302355]: Updating White Balance config:
[ INFO] [1663326633.502453850]:  - BalanceRatioSelector set to Red
[ WARN] [1663326633.503879471]:  - Tried to set BalanceRatio to 1.79 but the camera used 1.79004 instead
[ INFO] [1663326633.504000999]:  - BalanceRatioSelector set to Blue
[ WARN] [1663326633.505005458]:  - Tried to set BalanceRatio to 1.85 but the camera used 1.8501 instead
[ INFO] [1663326633.506122508]:  - BalanceWhiteAuto set to Continuous
[ INFO] [1663326633.506276407]: Updating Image Mode config:
[ INFO] [1663326633.509418636]:  - BinningHorizontal set to 1
[ INFO] [1663326633.512867560]:  - BinningVertical set to 1
[ INFO] [1663326633.512912475]: Updating ROI config:
[ INFO] [1663326633.518037080]:  - Width set to 1456
[ INFO] [1663326633.521876449]:  - Height set to 1088
[ INFO] [1663326633.525687404]:  - OffsetX set to 0
[ INFO] [1663326633.529643322]:  - OffsetY set to 0
[ INFO] [1663326633.529743330]: Updating Bandwidth config:
[ INFO] [1663326633.533284889]:  - DeviceLinkThroughputLimit set to 450000000
[ INFO] [1663326633.533373345]: Updating GPIO config:
[ INFO] [1663326633.533414603]: Updating USB GPIO config:
[ INFO] [1663326633.533971740]:  - LineSelector set to Line0
[ INFO] [1663326633.536273538]:  - LineMode set to Input
[ INFO] [1663326633.536329063]: Updating PTP config:
[ INFO] [1663326633.536352717]: Updating PixelFormat config:
[ INFO] [1663326633.696892155]:  - PixelFormat set to BayerRG8
[ INFO] [1663326634.347761674]:  - SensorBitDepth set to Adaptive
[ INFO] [1663326634.347837086]: Updating Acquisition and Trigger config:
[ INFO] [1663326634.350388844]:  - AcquisitionMode set to Continuous
[ INFO] [1663326634.352746887]:  - AcquisitionFrameRateEnable set to 1
[ WARN] [1663326634.355332148]:  - Tried to set AcquisitionFrameRate to 30 but the camera used 30 instead
[ WARN] [1663326634.355773347]: Feature TriggerMode is not writable.
[ INFO] [1663326634.355931625]:  - TriggerMode set to Off
[ INFO] [1663326634.356100132]:  - TriggerSelector set to FrameStart
[ INFO] [1663326634.357037985]:  - TriggerSource set to Software
[ INFO] [1663326634.357840374]:  - TriggerActivation set to RisingEdge
[ INFO] [1663326634.358938959]:  - TriggerDelay set to 0
[ INFO] [1663326634.358969587]: Updating Iris config:
[ INFO] [1663326634.364099783]: Starting continuous image acquisition ...
[ INFO] [1663326634.364186005]: camera calibration URL: file:///home/mathieu/rover_ws/src/avt_vimba_camera/calibrations/calibration_example.yaml
ERR: FrameObserver VmbFrameStatusIncomplete
MatCapLynx commented 1 year ago

This was solved by changing pixel_format to RGB8.