neufieldrobotics / spinnaker_sdk_camera_driver

Point Grey (FLIR) Spinnaker based camera driver (Blackfly S etc.)
MIT License
125 stars 91 forks source link

Error: unable to set BinningHorizontal to 1 (ptr retrieval) #127

Open nicewiz opened 3 years ago

nicewiz commented 3 years ago

System Description Camera Name and Model: Grasshopper3 GS3-U3-123S6C Operating System: Ubuntu 16.04 Spinnaker Version: 2.0.0.147 ROS Version: kinetic 1.12.17

Computer details Processor:Intel i7-7500U 2.70GHz RAM: 8GB

Multiple Cameras Only How is the triggering setup? Master/Slave or all slaves or all software triggered?

For USB 3.0 cameras: On same USB 3.0 bus or different buses? Is the USB 3.0 hub externally powered?

For Ethernet cameras: How busy is the network, does the system work in grayscale, at a lower resoultion (binning) and framerate?

Do the cameras work with SpinView? Yes, perfectly.

Describe the bug I have installed the spinnaker_sdk_camera_driver as described in the readme file, but run into following error(s) when launching the acquisition.launch file:

[FATAL] [1618388473.689578333]: Unable to set BinningHorizontal to 1 (ptr retrieval). Aborting...
[FATAL] [1618388473.689773938]: Error: Spinnaker: GenICam::AccessException= Node is not writable. : AccessException thrown in node 'BinningHorizontal' while calling 'BinningHorizontal.SetValue()' (file 'IntegerT.h', line 77) [-2006]
[ WARN] [1618388473.689795455]: Most likely cause for this error is if your camera can't support color and your are trying to set it to color mode
[FATAL] [1618388473.890316354]: Failed to load nodelet '/acquisition_node` of type `acquisition/Capture` to manager `vision_nodelet_manager'
terminate called after throwing an instance of 'Spinnaker::Exception'
  what():  Spinnaker: GenICam::AccessException= Node is not writable. : AccessException thrown in node 'TriggerSoftware' while calling 'TriggerSoftware.Execute()' (file 'CommandT.h', line 61) [-2006]
[acquisition_node-2] process has died [pid 4387, exit code 255, cmd /opt/ros/kinetic/lib/nodelet/nodelet load acquisition/Capture vision_nodelet_manager __name:=acquisition_node __log:=/home/chandler/.ros/log/2bebec98-9cf7-11eb-8163-d0577bf7c33a/acquisition_node-2.log].
log file: /home/chandler/.ros/log/2bebec98-9cf7-11eb-8163-d0577bf7c33a/acquisition_node-2*.log
[vision_nodelet_manager-1] process has died [pid 4386, exit code -6, cmd /opt/ros/kinetic/lib/nodelet/nodelet manager __name:=vision_nodelet_manager __log:=/home/chandler/.ros/log/2bebec98-9cf7-11eb-8163-d0577bf7c33a/vision_nodelet_manager-1.log].
log file: /home/chandler/.ros/log/2bebec98-9cf7-11eb-8163-d0577bf7c33a/vision_nodelet_manager-1*.log

both cameras are recognized and stated as "connected" in the output.I have set Binning to 0 or other values, and color mode is deactivated and still got the following error.

Error Messages

SUMMARY
========

PARAMETERS
 * /acquisition_node/binning: 1
 * /acquisition_node/cam_aliases: ['cam0']
 * /acquisition_node/cam_ids: [17392138]
 * /acquisition_node/color: False
 * /acquisition_node/delay: 1.0
 * /acquisition_node/distortion_coeffs: [[-0.021141875266...
 * /acquisition_node/distortion_model: plumb_bob
 * /acquisition_node/exposure_time: 0
 * /acquisition_node/external_trigger: False
 * /acquisition_node/flip_horizontal: [False]
 * /acquisition_node/flip_vertical: [False]
 * /acquisition_node/frames: 3400
 * /acquisition_node/gain: 0
 * /acquisition_node/image_height: 1080
 * /acquisition_node/image_width: 1440
 * /acquisition_node/intrinsic_coeffs: [[1886.9232141485...
 * /acquisition_node/live: False
 * /acquisition_node/live_grid: False
 * /acquisition_node/master_cam: 17392138
 * /acquisition_node/max_rate_save: False
 * /acquisition_node/projection_coeffs: [[913.700317, 0.0...
 * /acquisition_node/rectification_coeffs: [[1.0, 0.0, 0.0, ...
 * /acquisition_node/region_of_interest/height: 0
 * /acquisition_node/region_of_interest/width: 0
 * /acquisition_node/region_of_interest/x_offset: 0
 * /acquisition_node/region_of_interest/y_offset: 0
 * /acquisition_node/save: False
 * /acquisition_node/save_path: ~
 * /acquisition_node/save_type: bmp
 * /acquisition_node/skip: 20
 * /acquisition_node/soft_framerate: 30
 * /acquisition_node/target_grey_value: 0
 * /acquisition_node/tf_prefix: 
 * /acquisition_node/time: False
 * /acquisition_node/to_ros: True
 * /acquisition_node/utstamps: False
 * /rosdistro: kinetic
 * /rosversion: 1.12.17

NODES
  /
    acquisition_node (nodelet/nodelet)
    vision_nodelet_manager (nodelet/nodelet)

ROS_MASTER_URI=http://localhost:11311

process[vision_nodelet_manager-1]: started with pid [4386]
process[acquisition_node-2]: started with pid [4387]
[ INFO] [1618388465.533586261]: Initializing nodelet with 4 worker threads.
[ INFO] [1618388465.613624907]: Initializing nodelet
[ INFO] [1618388465.614576737]: [ OK ] USB memory: 1000 MB
[ INFO] [1618388465.614630790]: *** PARAMETER SETTINGS ***
[ INFO] [1618388465.614648289]: ** Date = 20210414
[ INFO] [1618388465.615212399]:   Save path set via parameter to: /home/chandler
[ INFO] [1618388465.615251742]:   Camera IDs:
[ INFO] [1618388465.615683062]:     17392138
[ INFO] [1618388465.616078511]:   Camera Aliases:
[ INFO] [1618388465.616120003]:     17392138 >> cam0
[ INFO] [1618388465.616536077]:   External trigger: false
[ INFO] [1618388465.617229815]:   Unique time stamps for each camera: false
[ INFO] [1618388465.617575193]:   color set to: false
[ INFO] [1618388465.617969268]:   17392138 flip_horizontal 0
[ INFO] [1618388465.618314955]:   17392138 flip_vertical 0
[ INFO] [1618388465.618658579]:   Exporting images to ROS: true
[ INFO] [1618388465.619004935]:   Showing live images setting: false
[ INFO] [1618388465.619441389]:   Showing grid-style live images setting: false
[ INFO] [1618388465.619799679]:   Max Rate Save Mode: false
[ INFO] [1618388465.620188150]:   Displaying timing details: false
[ INFO] [1618388465.620557840]:   No. of images to skip set to: 20
[ INFO] [1618388465.620943414]:   Init sleep delays set to : 1.00 sec
[ WARN] [1618388465.621296696]:   'fps' Parameter not set, using default behavior: fps=20.00
[ INFO] [1618388465.621653592]:   'exposure_time'=0, Setting autoexposure
[ INFO] [1618388465.622039077]:   'gain' Parameter was zero or negative, using Auto gain based on target grey value
[ INFO] [1618388465.622459577]:   'target_grey_value'=0, Setting AutoExposureTargetGreyValueAuto to Continuous/ auto
[ INFO] [1618388465.622839931]:   Binning set to: 1
[ INFO] [1618388465.623206336]:   Using Software rate control, rate set to: 30
[ INFO] [1618388465.623556413]:   Saving images set to: 0
[ INFO] [1618388465.624640869]:   tf_prefix set to: 
[ INFO] [1618388465.627004561]:   Region of Interest set to width: 0    height: 0   offset_x: 0 offset_y: 0
[ INFO] [1618388465.627571050]:   Camera Intrinsic Paramters:
[ INFO] [1618388465.628308736]:    1886.923214 0.000000 604.721488 0.000000 1886.666877 493.477267 0.000000 0.000000 1.000000 
[ INFO] [1618388465.633985235]:   Camera Distortion Paramters:
[ INFO] [1618388465.634402930]:    -0.021142 -0.373387 2.385983 3.282457 
[ INFO] [1618388465.639795423]:   Camera Rectification Paramters:
[ INFO] [1618388465.640312800]:    1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 
[ INFO] [1618388465.642956599]:   Camera Projection Paramters:
[ INFO] [1618388465.643048976]:    913.700317 0.000000 953.448302 0.000000 0.000000 1063.296631 777.871993 0.000000 0.000000 0.000000 1.000000 0.000000 
[ INFO] [1618388465.643076998]:   Camera coeffs provided, camera info messges will be published.
[ INFO] [1618388465.643139950]: *** SYSTEM INFORMATION ***
[ INFO] [1618388465.643154250]: Creating system instance...
[ INFO] [1618388465.643170569]: spinnaker_sdk_camera_driver package version: 1.1.0
[ INFO] [1618388467.131616821]: Spinnaker library version: 2.0.0.147
[ INFO] [1618388467.131704254]: Retreiving list of cameras...
[ INFO] [1618388471.384641289]: Numer of cameras found: 1
[ INFO] [1618388471.384731102]:  Cameras connected: 1
[ INFO] [1618388471.385568560]:   -17392138 Grasshopper3 GS3-U3-123S6C FW:v2.25.3.01 FPGA:v2.02
[ INFO] [1618388471.491144179]: Dynamic Reconfigure: Level : 4294967295
[ INFO] [1618388471.492295405]: *** FLUSH SEQUENCE ***
[ INFO] [1618388471.492324067]: Initializing cameras...
[ INFO] [1618388471.583439808]: Deinitializing cameras...
[ INFO] [1618388471.587834859]: All cameras deinitialized.
[ INFO] [1618388473.588079004]: Initializing cameras...
[FATAL] [1618388473.689578333]: Unable to set BinningHorizontal to 1 (ptr retrieval). Aborting...
[FATAL] [1618388473.689773938]: Error: Spinnaker: GenICam::AccessException= Node is not writable. : AccessException thrown in node 'BinningHorizontal' while calling 'BinningHorizontal.SetValue()' (file 'IntegerT.h', line 77) [-2006]
[ WARN] [1618388473.689795455]: Most likely cause for this error is if your camera can't support color and your are trying to set it to color mode
[FATAL] [1618388473.890316354]: Failed to load nodelet '/acquisition_node` of type `acquisition/Capture` to manager `vision_nodelet_manager'
terminate called after throwing an instance of 'Spinnaker::Exception'
  what():  Spinnaker: GenICam::AccessException= Node is not writable. : AccessException thrown in node 'TriggerSoftware' while calling 'TriggerSoftware.Execute()' (file 'CommandT.h', line 61) [-2006]
[acquisition_node-2] process has died [pid 4387, exit code 255, cmd /opt/ros/kinetic/lib/nodelet/nodelet load acquisition/Capture vision_nodelet_manager __name:=acquisition_node __log:=/home/chandler/.ros/log/2bebec98-9cf7-11eb-8163-d0577bf7c33a/acquisition_node-2.log].
log file: /home/chandler/.ros/log/2bebec98-9cf7-11eb-8163-d0577bf7c33a/acquisition_node-2*.log
[vision_nodelet_manager-1] process has died [pid 4386, exit code -6, cmd /opt/ros/kinetic/lib/nodelet/nodelet manager __name:=vision_nodelet_manager __log:=/home/chandler/.ros/log/2bebec98-9cf7-11eb-8163-d0577bf7c33a/vision_nodelet_manager-1.log].
log file: /home/chandler/.ros/log/2bebec98-9cf7-11eb-8163-d0577bf7c33a/vision_nodelet_manager-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

Screenshots If applicable, add screenshots to help explain your problem.

Best Regards!

vik748 commented 3 years ago

Can you try commenting out the two lines where the binning is being set on the camera - https://github.com/neufieldrobotics/spinnaker_sdk_camera_driver/blob/f6ab2909ba2a4e250d7838331c83d4b588badb0f/src/capture.cpp#L686

nicewiz commented 3 years ago

We tried commenting out all the lines where fatal error occurred and it works out. Then we went and checked the camera settings in spinview and found that some valuables like BinningHorizontal might have been locked in our camera so the function SetIntValue() can't work. Also could be other reasons but not sure. Thanks for your advice! BTW how can we save the image data from camera in ros?

vik748 commented 3 years ago

In ROS you can just use rosbag record to save all the ROS messages.

Looks like the right way to address this would be to put https://github.com/neufieldrobotics/spinnaker_sdk_camera_driver/blob/f6ab2909ba2a4e250d7838331c83d4b588badb0f/src/camera.cpp#L173 line under else. That should throw an error but let the code continue.

nicewiz commented 3 years ago

we find it work if commenting out those lines throwing errors but in this way we cannot set the camera to color mode nor we can set acquisition rate to other values put ptr->SetValue(val); line under else may let code continue but cannot set color to rgb(should not work)

still trying other ways to solve it

ghost commented 3 years ago

@nicewiz you can use SpinView to figure out exactly which variables you need to play with to get your desired settings and then try to replicate that in the driver.

nicewiz commented 3 years ago

@shahvi This leads to a former question -> we find some variables in spinview are locked(cannot be changed or not in a correct operation?) So are there any relations between the error aforementioned on the top of this issue and the following code? if (!IsAvailable(ptr) || !IsWritable(ptr)) ROS_FATAL_STREAM("Unable to set " << setting << " to " << val << " (ptr retrieval). Aborting...");

vik748 commented 3 years ago

@nicewiz yes, if something is locked in SpinView, most likely we would not be able to change it from the driver.

nicewiz commented 3 years ago

Got it! Are there any methods to unlock them in SpinView? There are lots of important variables we wanna reset.

ghost commented 3 years ago

Usually I have seen that the variables that are locked or grayed out are not supported by the camera hardware. Eg. If the camera is Grayslake then color option is grayed out.

What variables are you trying to change?

nicewiz commented 3 years ago
  1. color as our camera Grasshopper3 GS3-U3-123S6C support the color mode
  2. acquisition frame rate to 20 or more as the rate the driver grab the image with fps 5 and some other variables.

Strangely we cannot set color in driver though color mode supported and acquisition frame rate is locked so we can't set it to 20 or more