Thread: Vision in Java
View Single Post
  #2   Spotlight this post!  
Unread 12-01-2015, 21:55
SquishyIce's Avatar
SquishyIce SquishyIce is offline
Registered User
FRC #1405 (Finney Falcons)
Team Role: Electrical
 
Join Date: Dec 2013
Rookie Year: 2012
Location: New York
Posts: 39
SquishyIce can only hope to improve
Re: Vision in Java

If you're just looking for getting vision on your dashboard with a USB camera, I stripped down the SimpleVision template to 3 lines of code that you run when initializing everything:

Code:
CameraServer camera = new CameraServer();
camera.setQuality(50);
camera.startAutomaticCapture("cam0");
When you start up the driver station while connected to a RoboRIO running this code, go to the FRC PC Dashboard. In the bottom left of the "drive" pane, there should be a dropdown menu with the options of no camera, SW camera, HW camera, and IP camera. I believe you set this to SW camera (If that doesn't work, try HW camera. It's one of the two. I honestly cant remember, even though I was using it literally 2 hours ago). This should give you a live camera feed in what was formerly a big empty space of the dashboard. One thing I did notice tonight about that string "cam0"; this does not name the camera, it determines what camera to get the feed from. I believe the first camera you connect is automatically addressed as "cam0". I could be wrong on this, I haven't tested using multiple cameras. I learned this the hard way by replacing "cam0" with "PotatoCam", then not understanding why I couldn't get any feed whatsoever.

Good luck!
__________________
"MAKE IT WORK, DAVID"
Reply With Quote