Vision Processing Limits


#21

Nice. But now when I deploy the code the robot code stays red in Driver Station and it gives the error message:
ERROR 1 Unhandled exception: VideoException [edu.wpi.cscore.VideoException: no camera available] frc.robot.Robot.robotInit(Robot.java:48)
line 48 being the compression-setting line. The camera is plugged in and when i remove that line it can display the video stream like normal.


#22

You are calling it after calling startAutomaticCapture(), correct? There’s another way to do it if that’s still not working:

CameraServer inst = CameraServer.getInstance();
UsbCamera camera = new UsbCamera("USB Camera 0", 0);
inst.addCamera(camera);
MjpegServer server = inst.addServer("serve_USB Camera 0");
server.setSource(camera);
server.getProperty("compression").set(value);

This basically mimics the behavior of startAutomaticCapture(0) but provides access to the MjpegServer object.


#23

Yeah, that was it. I feel stupid now… Anyway thank you SO much for all the replies guys. This turned a long time of troubleshooting into a couple days work.