Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Camera not relaying to Smartdashboard (http://www.chiefdelphi.com/forums/showthread.php?t=152444)

tig567899 28-11-2016 17:32

Camera not relaying to Smartdashboard
 
Hello CD,

My team and I are trying to get camera footage to the SmartDashboard, and we found from some sources to do this:
Code:

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

Re: Camera not relaying to Smartdashboard
 
A couple of things:
1) You need to reference the camera differently:
Code:

                    server.startAutomaticCapture("cam1");
2) You need to call setSize to specify resolution:
Code:

                    server.setSize(1); // force 320x240
You should also use the roboRIO WebDashboard 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

Re: Camera not relaying to Smartdashboard
 
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

Re: Camera not relaying to Smartdashboard
 
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.


All times are GMT -5. The time now is 04:50.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi