gelsightinc / gsrobotics

GelSight SDK for robotic sensors
GNU General Public License v3.0
80 stars 24 forks source link

Trouble openning up video source on gelsight mini #8

Closed neubotech closed 1 year ago

neubotech commented 1 year ago

Hello,

Thank you for shipping the gelsight mini. I've had trouble with the video streaming. I've tried python3 show3d_ros2.py -d mini, but received below error. Probably due to not being able to open up the right video device:

args[2]: ['show3d_ros2.py', '-d', 'mini'] 

 mini 

       video1 -> GelSight Mini R0B 28DJ-3ENE: Ge
       video0 -> GelSight Mini R0B 28DJ-3ENE: Ge
[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (713) open OpenCV | GStreamer warning: Error opening bin: empty pipeline not allowed
[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[ERROR:0] global ../modules/videoio/src/cap.cpp (116) open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.2.0) ../modules/videoio/src/cap_images.cpp:293: error: (-215:Assertion failed) !_filename.empty() in function 'open'

Warning: unable to open video source:  None
net path =  ./../nnmini.pt
self.finger =  Finger.R15
calling nn R15...
ERROR! reading image from camera
Traceback (most recent call last):
  File "show3d_ros2.py", line 250, in <module>
    main()
  File "show3d_ros2.py", line 238, in main
    pcd_publisher = PCDPublisher()
  File "show3d_ros2.py", line 131, in __init__
    elif f0.shape == (640, 480, 3):
AttributeError: 'NoneType' object has no attribute 'shape'

I've configured the video stream 0, and results showing below:

                    brightness 0x00980900 (int)    : min=-64 max=64 step=1 default=0 value=0
                       contrast 0x00980901 (int)    : min=0 max=64 step=1 default=32 value=32
                     saturation 0x00980902 (int)    : min=0 max=128 step=1 default=64 value=64
                            hue 0x00980903 (int)    : min=-40 max=40 step=1 default=0 value=0
 white_balance_temperature_auto 0x0098090c (bool)   : default=0 value=0
                          gamma 0x00980910 (int)    : min=72 max=500 step=1 default=140 value=140
                           gain 0x00980913 (int)    : min=0 max=100 step=1 default=0 value=0
           power_line_frequency 0x00980918 (menu)   : min=0 max=3 default=1 value=0
      white_balance_temperature 0x0098091a (int)    : min=2800 max=6500 step=1 default=4600 value=4500
                      sharpness 0x0098091b (int)    : min=0 max=6 step=1 default=3 value=3
         backlight_compensation 0x0098091c (int)    : min=0 max=2 step=1 default=1 value=0
              exposure_absolute 0x009a0902 (int)    : min=1 max=5000 step=1 default=156 value=180
         exposure_auto_priority 0x009a0903 (bool)   : default=0 value=0
                 focus_absolute 0x009a090a (int)    : min=0 max=15 step=1 default=3 value=3
                     focus_auto 0x009a090c (bool)   : default=0 value=0
unknown control 'exposure_auto'

Thank you for helping!

CarlDegio commented 1 year ago

change the camera name in code, replacing 'webcam' to 'GelSight' would be helpful

xiaoconghua commented 1 year ago

change the camera name in code, replacing 'webcam' to 'GelSight' would be helpful

works for me. To add more context, just follow the two comment lines in the code of the example

        # the device ID can change after chaning the usb ports.
        # on linux run, v4l2-ctl --list-devices, in the terminal to get the device ID for camera
debrashure commented 1 year ago

Thanks so much @CarlDegio and @xiaoconghua and @neubotech for pointing out the camera name issue. The code has been updated to use the correct name.