Go to Post Question: How can you tell the difference between an engineer and a programmer? Answer: You ask them to count. Engineers start counting from 1. Programmers start counting from 0. - Ed Law [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 02-12-2016, 10:13 AM
aweso_meme aweso_meme is offline
Registered User
FRC #4687
 
Join Date: Feb 2014
Location: Minnesota
Posts: 20
aweso_meme is an unknown quantity at this point
2 Cameras Setup (Lifecam HD 3000)

Hello all,

With the game this year being hard to navigate through, I would like to set up two cameras on our robot (in Java of course). However, I was only able to figure out how to get one set up. When both are plugged into the roborio, we do get 2 different camera anmes ("cam0" and "cam1"), so I attempted to set up the second camera using a similar method as the first, however this did not work. We are attempting to use the SmartDashboard for Java, and only one of the cameras showed up (with a second USB camera module on the dashboard, the first camera was duplicated). As was mentioned in the title, we are using two Microsoft Lifecam HD 3000s, and we do not have an axis camera.

Does anyone know how to get this working? I'm open to all suggestions -- I'll update this information if you guys request it.

Thank you all,
--aweso_meme, Team 4687 programmer
Reply With Quote
  #2   Spotlight this post!  
Unread 02-12-2016, 11:52 AM
ghead ghead is offline
Registered User
FRC #3103
 
Join Date: Aug 2013
Location: US
Posts: 13
ghead is an unknown quantity at this point
Re: 2 Cameras Setup (Lifecam HD 3000)

The following post has some sample c++ code that handles 2 USB cameras. It might point you the right direction.

http://www.chiefdelphi.com/forums/sh...25&postcount=6
Reply With Quote
  #3   Spotlight this post!  
Unread 02-14-2016, 09:45 AM
Andy Sheu Andy Sheu is offline
Registered User
FRC #0972 (Iron Claw)
Team Role: Programmer
 
Join Date: Sep 2015
Rookie Year: 2014
Location: San Jose
Posts: 6
Andy Sheu is an unknown quantity at this point
Re: 2 Cameras Setup (Lifecam HD 3000)

My team is using two USB Cameras and Java. However, we are swapping between them, rather than steaming both at the same time.

Our code can be found here: https://github.com/iron-claw-972/FRC...bot/Robot.java

Look at lines 182-194 and 409-480 (may change in later commits)
Reply With Quote
  #4   Spotlight this post!  
Unread 02-14-2016, 07:52 PM
BenBernard BenBernard is offline
Registered User
FRC #5687 (The Outliers)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Portland, ME
Posts: 39
BenBernard is an unknown quantity at this point
Re: 2 Cameras Setup (Lifecam HD 3000)

We are also streaming only one camera at a time. There are a couple of tricks to this:

1) In Robot.init, instantiate a USBCamera instance for each camera. Then when you call CameraServer.startAutomaticCapture, pass in the default camera.

2) You'll need a Command, probably triggered by a button, to switch cameras. The natural thing to want to do is to simply call startAutomaticCapture again, passing in the other USBCamera instance. That won't work, because of the way startAutomaticCapture is implemented. To solve this, you'll have to create your OWN version of CameraServer (copy, paste, rename), and change the startAutomaticCapture to stopCapture on the camera already in use, if any (m_camera), set the new camera, then startCapture on the new camera.

If you need more details, let me know.
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 02:39 AM.

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