View Single Post
  #9   Spotlight this post!  
Unread 07-23-2016, 02:47 PM
bdaroz's Avatar
bdaroz bdaroz is offline
Programming Mentor
AKA: Brian Rozmierski
FRC #5881 (TVHS Dragons)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Albany, NY
Posts: 372
bdaroz has much to be proud ofbdaroz has much to be proud ofbdaroz has much to be proud ofbdaroz has much to be proud ofbdaroz has much to be proud ofbdaroz has much to be proud ofbdaroz has much to be proud ofbdaroz has much to be proud ofbdaroz has much to be proud of
Re: 2 Cameras in Java

Quote:
Originally Posted by GoldenGollem View Post
Thanks for that info. What we will most likely end up doing is having two cameras but only streaming one at a time to the dashboard. This is the latest version of code that we have for it.(FYI this was in a command format but was changed for simplicity of this site)
The problem is that the native WPILib CameraServer class doesn't have a way to stop, or switch, or restart the server instance. You'll need to extend/replace that CameraServer class to make it work. Here's what we ended up doing, albeit a bit quick and dirty:

https://github.com/FRC5881/2016Robot...eraServer.java

Quote:
Originally Posted by euhlmann View Post
Yep, it wouldn't show up on the web interface. We checked with a hub that measures current draw and it looked ok. I guess we should try with a powered hub though.
Keep in mind that USB is designed to not overdraw current... If you have 500ma of power available and plug in (2) 400ma devices, your hub will only draw a bit over 400ma (a little for itself) and leave the other device unpowered.

You should also be able to plug those cameras into a PC and check the USB device info (lsusb on linux, for example) to see what the current required for each is. After that, some simple math would tell you if you're over committing.

One other question -- are both of these cameras identical?
Reply With Quote