neufieldrobotics / spinnaker_sdk_camera_driver

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

Unable to set PixelFormat to BGR8 #148

Open nicetryzz opened 2 years ago

nicetryzz commented 2 years ago

System Description Camera Name and Model:BFLY-U3-23S6C-C Operating System:Ubuntu 18.04 Spinnaker Version: 2.2.0.48 ROS Version: melodic 1.14.3

Computer details Processor: Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz

Do the cameras work with SpinView? Yes, it can show RGB image.

Describe the bug By commenting several lines mentions by FATAL errors, the gray scale image can be visualized through rqt_image_view. But it still have error when changing color to true, while SpinView can show RGB image.

Error Messages roslaunch spinnaker_sdk_camera_driver acquisition.launch ... logging to /home/robot2/.ros/log/acac6bf2-a83e-11ec-8a67-f4d108339898/roslaunch-robot2-910-24701.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://robot2-910:38815/

SUMMARY

PARAMETERS

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

ROS_MASTER_URI=http://localhost:11311

process[vision_nodelet_manager-1]: started with pid [24716] process[acquisition_node-2]: started with pid [24717] [ INFO] [1647779781.468808743]: Initializing nodelet with 8 worker threads. [ INFO] [1647779781.564471604]: Initializing nodelet [ INFO] [1647779781.565330707]: [ OK ] USB memory: 1000 MB [ INFO] [1647779781.565403721]: PARAMETER SETTINGS [ INFO] [1647779781.565437236]: ** Date = 20220320 [ INFO] [1647779781.566003782]: Save path set via parameter to: /home/robot2 [ INFO] [1647779781.566031351]: Camera IDs:

[ INFO] [1647779781.566812453]: Camera Aliases: [ INFO] [1647779781.566833431]: 18355343 >> cam0 [ INFO] [1647779781.567204194]: External trigger: false [ INFO] [1647779781.567873531]: Unique time stamps for each camera: false [ INFO] [1647779781.568181510]: color set to: true [ INFO] [1647779781.568566525]: 18355343 flip_horizontal 0 [ INFO] [1647779781.568919339]: 18355343 flip_vertical 0 [ INFO] [1647779781.569265452]: Exporting images to ROS: true [ INFO] [1647779781.569593694]: Showing live images setting: false [ INFO] [1647779781.569946773]: Showing grid-style live images setting: false [ INFO] [1647779781.570312210]: Max Rate Save Mode: false [ INFO] [1647779781.570621499]: Displaying timing details: false [ INFO] [1647779781.570925149]: No. of images to skip set to: 20 [ INFO] [1647779781.571218234]: Init sleep delays set to : 1.00 sec [ INFO] [1647779781.571490337]: 'exposure_time'=0, Setting autoexposure [ INFO] [1647779781.571697555]: 'gain' Parameter was zero or negative, using Auto gain based on target grey value [ INFO] [1647779781.572001137]: 'target_grey_value'=0, Setting AutoExposureTargetGreyValueAuto to Continuous/ auto [ INFO] [1647779781.572271215]: Binning set to: 2 [ INFO] [1647779781.572519116]: Using Software rate control, rate set to: 20 [ INFO] [1647779781.572785367]: Saving images set to: 0 [ INFO] [1647779781.573452687]: tf_prefix set to: [ INFO] [1647779781.574373466]: Region of Interest set to width: 0 height: 0 offset_x: 0 offset_y: 0 [ INFO] [1647779781.574673725]: Camera Intrinsic Paramters: [ INFO] [1647779781.574926437]: 1886.923214 0.000000 604.721488 0.000000 1886.666877 493.477267 0.000000 0.000000 1.000000 [ INFO] [1647779781.575151651]: Camera Distortion Paramters: [ INFO] [1647779781.575192451]: -0.021142 -0.373387 2.385983 3.282457 [ INFO] [1647779781.575449834]: Camera Rectification Paramters: [ INFO] [1647779781.575475599]: 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 [ INFO] [1647779781.575798343]: Camera Projection Paramters: [ INFO] [1647779781.575835167]: 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] [1647779781.575846865]: Camera coeffs provided, camera info messges will be published. [ INFO] [1647779781.575926838]: SYSTEM INFORMATION [ INFO] [1647779781.575938083]: Creating system instance... [ INFO] [1647779781.575947664]: spinnaker_sdk_camera_driver package version: 1.1.1 [ INFO] [1647779782.571878698]: Spinnaker library version: 2.2.0.48 [ INFO] [1647779782.571943715]: Retreiving list of cameras... [ INFO] [1647779782.579781382]: Numer of cameras found: 1 [ INFO] [1647779782.579896802]: Cameras connected: 1 [ INFO] [1647779782.581048972]: -18355343 Blackfly BFLY-U3-23S6C FW:v1.8.3.00 FPGA:v2.02 [ INFO] [1647779782.647405477]: Dynamic Reconfigure: Level : 4294967295 [ INFO] [1647779782.648083962]: FLUSH SEQUENCE [ INFO] [1647779782.648104807]: Initializing cameras... [ INFO] [1647779782.757467257]: Deinitializing cameras... [ INFO] [1647779782.762850258]: All cameras deinitialized. [ INFO] [1647779784.763082049]: Initializing cameras... [FATAL] [1647779784.891854336]: Unable to set PixelFormat to BGR8 (entry retrieval). Aborting... [FATAL] [1647779784.891935268]: Error: Spinnaker: LogicalErrorException NULL pointer dereferenced [-2005] [ WARN] [1647779784.891954428]: 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] [1647779785.117272730]: Failed to load nodelet '/acquisition_nodeof typeacquisition/Captureto managervision_nodelet_manager' [acquisition_node-2] process has died [pid 24717, exit code 255, cmd /opt/ros/melodic/lib/nodelet/nodelet load acquisition/Capture vision_nodelet_manager __name:=acquisition_node log:=/home/robot2/.ros/log/acac6bf2-a83e-11ec-8a67-f4d108339898/acquisition_node-2.log]. log file: /home/robot2/.ros/log/acac6bf2-a83e-11ec-8a67-f4d108339898/acquisition_node-2*.log [vision_nodelet_manager-1] process has died [pid 24716, exit code -11, cmd /opt/ros/melodic/lib/nodelet/nodelet manager name:=vision_nodelet_manager __log:=/home/robot2/.ros/log/acac6bf2-a83e-11ec-8a67-f4d108339898/vision_nodelet_manager-1.log]. log file: /home/robot2/.ros/log/acac6bf2-a83e-11ec-8a67-f4d108339898/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 Screenshot from 2022-03-20 20-31-00 Screenshot from 2022-03-20 20-34-07

vik748 commented 2 years ago

We set the color mode at https://github.com/neufieldrobotics/spinnaker_sdk_camera_driver/blob/9c9633038c17d06f4ba11da9a97dddeb59c0d72a/src/capture.cpp#L722

It is possible that your camera doesn't have BGR8 but has some other color mode. I think you can look it up in SpinView settings.