Go to Post Let gravity be your friend. - MrForbes [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-11-2016, 17:32
tig567899's Avatar
tig567899 tig567899 is offline
Registered User
FRC #6070 (Gryphon Machine)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Mississauga
Posts: 28
tig567899 is an unknown quantity at this point
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.
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 28-11-2016, 20:01
BenBernard BenBernard is offline
Registered User
FRC #5687 (The Outliers)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Portland, ME
Posts: 36
BenBernard is an unknown quantity at this point
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-12-2016, 13:06
beijing_strbow beijing_strbow is offline
Registered User
FRC #5968 (Cyborg Indians)
Team Role: Programmer
 
Join Date: Aug 2016
Rookie Year: 2016
Location: Kansas
Posts: 21
beijing_strbow is an unknown quantity at this point
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."
Reply With Quote
  #4   Spotlight this post!  
Unread 25-12-2016, 08:17
tig567899's Avatar
tig567899 tig567899 is offline
Registered User
FRC #6070 (Gryphon Machine)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Mississauga
Posts: 28
tig567899 is an unknown quantity at this point
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.
__________________
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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