Log in

View Full Version : Camera not relaying to Smartdashboard


tig567899
28-11-2016, 17:32
Hello CD,

My team and I are trying to get camera footage to the SmartDashboard, and we found from some sources to do this:
Command autonomousCommand;
SendableChooser chooser;
public static CameraServer cam1;
public void robotInit() {
...
cam1 = CameraServer.getInstance();
cam1.setQuality(50);
cam1.startAutomaticCapture("Camera-1");}


But it's not working. We're able to see that the camera is recording at 30 fps, but 0 Mbps is sending back to the computer. Does anyone know if there's anything I can change in the SmartDashboard? The camera is a standard PC USB Camera. Thanks.

BenBernard
28-11-2016, 20:01
A couple of things:
1) You need to reference the camera differently:
server.startAutomaticCapture("cam1");

2) You need to call setSize to specify resolution:
server.setSize(1); // force 320x240


You should also use the roboRIO WebDashboard (https://wpilib.screenstepslive.com/s/4485/m/24194/l/288981-using-the-microsoft-lifecam-hd-3000) to double-check that the rio sees the camera and that it's really on the cam1 port. Note that the link assumes you're using the Lifecam-3000, but holds true for any USB camera.

Also, be sure to select USB Camera SW on the default dashboard.

beijing_strbow
24-12-2016, 13:06
If you try to send other data to the SmartDashboard, can you see it? If not, I would make sure you have the correct team number in the dashboard.

Also, as BenBernard said, make sure you have the correct camera name. For us, it's "cam0."

tig567899
25-12-2016, 08:17
Hey guys

Thanks for the help. It turns out the code was right, but our camera is so old it only worked on Windows XP and we couldn't install the driver onto our computer. We're getting a new camera for the 2017 season.