Go to Post I suggested it in brainstorming, but then people threw things at me. Apparently there ARE bad ideas in brainstorming. - Kevin Sevcik [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 29-12-2016, 16:51
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: 25
beijing_strbow is an unknown quantity at this point
Two USB Cameras

We're trying to connect 2 USB cameras to the roborio, and would like to process the images from one, and stream the other to the driver station. We have the streaming working with mjpg-streamer. However, when we try to get images from the other camera, we get an "internal error" (IMAQdxError -1074360319). I'm fairly sure we are accessing the correct camera, because we get a "camera already in use error" otherwise.

The image processing camera is a LifeCam hd-3000, though the streaming camera is something different at t the moment.
Reply With Quote
  #2   Spotlight this post!  
Unread 29-12-2016, 22:47
SamcFuchs's Avatar
SamcFuchs SamcFuchs is offline
Programmer
AKA: Sam Fuchs
FRC #0236 (TechnoTicks)
Team Role: Programmer
 
Join Date: Aug 2015
Rookie Year: 2014
Location: Old Lyme, Connecticut
Posts: 54
SamcFuchs is a splendid one to beholdSamcFuchs is a splendid one to beholdSamcFuchs is a splendid one to beholdSamcFuchs is a splendid one to beholdSamcFuchs is a splendid one to beholdSamcFuchs is a splendid one to beholdSamcFuchs is a splendid one to beholdSamcFuchs is a splendid one to behold
Re: Two USB Cameras

I was told at an event that the only camera that is tested and confirmed to work is the LifeCam. Anything else, and you're on your own.
__________________
Sam Fuchs
236 TechnoTicks, Old Lyme, CT

2015 - Programming, Electrical
2016 - Lead Programmer, Co-Driver
2017 - Lead Programmer, Co-Driver
Reply With Quote
  #3   Spotlight this post!  
Unread 29-12-2016, 22:54
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: 373
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: Two USB Cameras

Does the 2nd camera show up in the RoboRIO dashboard?
Reply With Quote
  #4   Spotlight this post!  
Unread 30-12-2016, 11:25
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: 25
beijing_strbow is an unknown quantity at this point
Re: Two USB Cameras

The other camera does show up, but it is listed as two devices on the webdashboard, which could be the problem. We may just wait until we can get another LifeCam.
Reply With Quote
  #5   Spotlight this post!  
Unread 30-12-2016, 13:22
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 304
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Two USB Cameras

Quote:
Originally Posted by beijing_strbow View Post
The other camera does show up, but it is listed as two devices on the webdashboard, which could be the problem. We may just wait until we can get another LifeCam.
Could you post a screenshot of the web dashboard?
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #6   Spotlight this post!  
Unread 30-12-2016, 13:25
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 987
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Two USB Cameras

What resolutions and framerates are you trying to get from the two cameras? You may be maxing out the USB bandwidth.
Reply With Quote
  #7   Spotlight this post!  
Unread 30-12-2016, 14:13
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: 25
beijing_strbow is an unknown quantity at this point
Re: Two USB Cameras

I don't have access to the webdashboard at the moment, and won't for a few days, but on USB it shows the LifeCam labeled cam0, the second camera labeled cam1, and again the second camera labeled something like USB0::####::####::NI-VISA-1005::2::RAW, where # is a number or letter that I don't remember.

Both cameras work fine by themselves, but using them together causes an error.

We aren't maxing out the bandwidth, because the error occurs when we call NIVision.IMAQdxOpenCamera(), before any image data is passed to the roboRIO.
Reply With Quote
  #8   Spotlight this post!  
Unread 30-12-2016, 15:18
Dan Waxman Dan Waxman is offline
Registered User
FRC #0263 (Aftershock)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2016
Location: Long Island
Posts: 30
Dan Waxman is an unknown quantity at this point
Re: Two USB Cameras

If I recall correctly, the USBCamera class is implemented as a singleton, and as a result you can't use two cameras in any intuitive way. There's a chance I'm wrong on that, but I recall my team messing around with it and looking at the source code and I believe that was the takeaway. I remember there was a hacky way here on CD not too long ago though. I found it easier to just use an IP Camera and USB camera instead of two USBs, but I'm pretty sure there is a way.
Reply With Quote
  #9   Spotlight this post!  
Unread 30-12-2016, 23:15
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: 25
beijing_strbow is an unknown quantity at this point
Re: Two USB Cameras

According to this post, the error occurs when opening the second camera will use more than the allowable USB bandwidth:

https://www.chiefdelphi.com/forums/s...8&postcount=32

I guess I'll try decreasing resolution and FPS once I have access to the robot again.
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 06:45.

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