View Single Post
  #1   Spotlight this post!  
Unread 07-21-2016, 10:05 PM
GoldenGollem's Avatar
GoldenGollem GoldenGollem is offline
Java Programmer
FRC #2509 (Hutchinson Tigerbots)
Team Role: Programmer
 
Join Date: Dec 2015
Rookie Year: 2015
Location: Minnesota
Posts: 24
GoldenGollem is an unknown quantity at this point
Lightbulb 2 Cameras in Java

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");
        }
Reply With Quote