Hello World,
As my team has been working this off season we were wondering if we would be able to use two USB cameras on our robot. We know that it is legal but we were wondering on the coding side what it would take. We are not able to test the code on the actual robot so, we only have theory to go on. Anyway, in theory this is all that should be needed to run two usb cameras at the same time on the Java SmartDashboard.
Code:
public class Robot extends IterativeRobot {
CameraServer server;
CameraServer server2;
public void robotInit() {
RobotMap.init();
//This is for the USB Camera
server = CameraServer.getInstance();
server.setQuality(50);
//Replace cam0 with acutal name
server.startAutomaticCapture("cam0");
server2 = CameraServer.getInstance();
server2.setQuality(50);
//Replace cam1 with actual name
server2.startAutomaticCapture("cam1");
}