ros-drivers/usb_cam

`yuyv2rgb` is unsupported/ segmentation fault after humble recent (?) upgrade for rpicamera

lmendyk opened this issue · 2 comments

It worked some time ago for humble release ( #299 )
After recent upgrade of pages I get:

This device supports the following formats:
terminate called after throwing an instance of 'std::invalid_argument'
  what():  Specified format `**yuyv2rgb**` is unsupported by the selected device `/dev/video0`
[ros2run]: Aborted

But when for testing I specify for “test” I get:

This driver supports the following formats:
        rgb8
        yuyv
        **yuyv2rgb**
        uyvy
        uyvy2rgb
        mono8
        mono16
        y102mono8
        raw_mjpeg
        mjpeg2rgb
        m4202rgb
terminate called after throwing an instance of 'std::invalid_argument'
  what():  Specified format `test` is unsupported by this ROS driver

After experimenting and adding av_device_format:="YVYU" it gets even worse:

[INFO] [1723628892.506987172] [usb_cam]: Starting 'default_cam' (/dev/video0) at 640x480 via mmap (yuyv2rgb) at 30 FPS
[ros2run]: Segmentation fault

The camera supports:

v4l2-ctl --list-formats-ext -d /dev/video0
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'YU12' (Planar YUV 4:2:0)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [1]: 'YUYV' (YUYV 4:2:2)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [2]: 'RGB3' (24-bit RGB 8-8-8)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [3]: 'JPEG' (JFIF JPEG, compressed)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [4]: 'H264' (H.264, compressed)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [5]: 'MJPG' (Motion-JPEG, compressed)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [6]: 'YVYU' (YVYU 4:2:2)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [7]: 'VYUY' (VYUY 4:2:2)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [8]: 'UYVY' (UYVY 4:2:2)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [9]: 'NV12' (Y/CbCr 4:2:0)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [10]: 'BGR3' (24-bit BGR 8-8-8)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [11]: 'YV12' (Planar YVU 4:2:0)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [12]: 'NV21' (Y/CrCb 4:2:0)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2
        [13]: 'RX24' (32-bit XBGR 8-8-8-8)
                Size: Stepwise 32x32 - 3280x2464 with step 2/2

I don't know what to do to make the camera work again.

@lmendyk what image format are you trying to use? What image format do you want this driver to publish with?

YUYV to RGB with compression - that is what I have been using so far and now it hast stop working.

The situation that system first reports " Specified format yuyv2rgb is unsupported" but when testing it prints: This driver supports the following formats: ...yuyv2rgb, does not help me to understand what is going on.