We have a few USB cameras kicking around. We have gotten all of them sending data to the smartdashboard via FRCVision on the Raspberry Pi. However, we are trying to connect one of them directly to the Rio, and stream that output to the SmartDashboard.
The “basic program” to do this is given in the wpilib docs as
Simple enough, and it works fine…for cameras that output an MPeg stream. However, a couple of our cameras are YUYV. Using the Pi, we set the appropriate parameters, and voila, we see it on the smartdashboard. Now I’m trying to do the same thing on the rio. Here’s the code I thought might work.
camera1=new UsbCamera(“Fred”, 0);
camera1.setVideoMode(PixelFormat.kYUYV, 320, 240, 30);
Not seeing anything. Nothing’s crashing, but no image available.
(I’ve tried a few more complex things, with CvSource and CvSink and such, but none of those work, either. This seems like the simplest set of code that I thought might have worked.)
As noted, I can get that image if I use FRCVision on a raspberry pi and enter those vision parameters, but on the Rio, nothing.