yarp
yarp copied to clipboard
usbCamera and usbCameraRaw crash in RAW mode, when started as subdevice
The following commands cause a segmentation fault:
yarpdev --device grabberDual --subdevice usbCamera --capabilities RAW --d /dev/video0
yarpdev --device grabberDual --subdevice usbCameraRaw --capabilities RAW --d /dev/video0
While investigating this, we found out that the size of the buffer returned by v4l2 is twice as big as a mono image of the same size, therefore the memcopy tries to write too many bytes and causes the segmentation fault.
Surprisingly, the following command sometimes work, probably due to some race condition, even if the grabberDual is instantiated anyway by yarpdev.
yarpdev --device usbCamera --capabilities RAW --d /dev/video0
yarpdev --device usbCameraRaw --capabilities RAW --d /dev/video0
I'm not completely sure that the received image is correct thought. I'm confused by the fact that the "RAW" interface, which should be returning the buffer exactly as received by the camera (and therefore could have any size, depending on the format returned by the camera), returns an ImageOf<PixelMono> which size of the buffer is exactly height*width. I believe this might be a bug in the API.

The fact that the image is flickering, makes me think that the actual image is twice as big, and it is returned as 2 separate images.