Go to Post Holonomic? I thought we were holographic. Or was that autonomic? I'm confused.... - Wayne C. [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 18-01-2013, 10:38
mls0.5 mls0.5 is offline
Registered User
FRC #0053
 
Join Date: Jan 2013
Location: greenbelt
Posts: 4
mls0.5 is an unknown quantity at this point
Two Axis Cameras

Our team is trying to use stereoscopic vision this year on our robot, but we are having trouble using two Axis Cameras. We are using FRC Java. We can get the first camera with AxisCamera.getInstance("10.0.53.11') and we can get the second with AxisCamera.getInstance("10.0.53.12") BUT we can only get one at a time. If we try to get both, both lines return the same camera. So if we try to get the one on 10.0.53.11 first, both lines will return that camera, and if the try to get the one on 10.0.53.12 first, both lines return the one on *.12.

Thanks for any help.
Reply With Quote
  #2   Spotlight this post!  
Unread 18-01-2013, 10:55
MagiChau's Avatar
MagiChau MagiChau is offline
Registered User
AKA: Michael Chau
FRC #0085 (B.O.B. (Built on Brains))
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Zeeland, Michigan
Posts: 875
MagiChau is just really niceMagiChau is just really niceMagiChau is just really niceMagiChau is just really nice
Re: Two Axis Cameras

the AxisCamera is a singleton. So you would have to make a modified version of the AxisCamera class to be able to construct more than one.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-01-2013, 11:06
mls0.5 mls0.5 is offline
Registered User
FRC #0053
 
Join Date: Jan 2013
Location: greenbelt
Posts: 4
mls0.5 is an unknown quantity at this point
Re: Two Axis Cameras

Thank you for your response, would you have any idea how to do that, or know of any examples of something like that?
Reply With Quote
  #4   Spotlight this post!  
Unread 18-01-2013, 11:38
SBrosious's Avatar
SBrosious SBrosious is offline
AngelicArtist
AKA: Sebastian Brosious
FRC #4085 (Techinical Difficulties)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Ohio
Posts: 9
SBrosious is an unknown quantity at this point
Re: Two Axis Cameras

My team was able to achieve this in labview but not in Java, we are going to try this year. If you use labview i could be more of help so message me if you opt to labview.
Reply With Quote
  #5   Spotlight this post!  
Unread 18-01-2013, 13:06
Johnbot's Avatar
Johnbot Johnbot is offline
Es Brokein!
AKA: John Westhoff
FRC #4791 (Pandroids)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Horsham, PA
Posts: 92
Johnbot is just really niceJohnbot is just really niceJohnbot is just really niceJohnbot is just really niceJohnbot is just really nice
Re: Two Axis Cameras

Quote:
Originally Posted by mls0.5 View Post
Thank you for your response, would you have any idea how to do that, or know of any examples of something like that?
You can get the source for the Axis Camera by extracting
C:\Users\YOUR_USERNAME_HERE\sunspotfrcsdk\lib\wpil ibj.src.zip
Then going to edu\wpi\first\wpilibj\camera.
In that folder, there is the AxisCamera source file. From here, you should create a new class in your Netbeans project, and copy the entire source from AxisCamera.java into it.
(I would recommend changing the name of your new class to something like AxisCamera2.)

Alternatively, if you want to change the library class itself, you can edit the class to house an array of AxisCameras, and when you call getInstance, it doesn't change a variable, but instead adds to an array.

Also, if you only need to access the camera for things like changing the settings at robotInit, you could add a method that nullifies the variable m_instance, so that you can construct a camera, use it, nullify the AxisCamera's static camera object, and then construct the second.

Any of these should work for the Java front, but as the NativeLibrary is used for nearly every method, I'm not sure that that is all you have to do.

Do you need to instantiate two AxisCameras on your cRIO? What do you need to do that for?
__________________

2011-2014 - FRC 2607 - Student
2012-2012 - FLL 2249 - Coach
2015- ???? - FRC 4791 - Mentor
Reply With Quote
  #6   Spotlight this post!  
Unread 18-01-2013, 18:10
mls0.5 mls0.5 is offline
Registered User
FRC #0053
 
Join Date: Jan 2013
Location: greenbelt
Posts: 4
mls0.5 is an unknown quantity at this point
Re: Two Axis Cameras

Quote:
Originally Posted by SBrosious View Post
My team was able to achieve this in labview but not in Java, we are going to try this year. If you use labview i could be more of help so message me if you opt to labview.
I am afraid no one on our team has any experience with labview, we exclusively use Java and C++
Reply With Quote
  #7   Spotlight this post!  
Unread 18-01-2013, 18:13
mls0.5 mls0.5 is offline
Registered User
FRC #0053
 
Join Date: Jan 2013
Location: greenbelt
Posts: 4
mls0.5 is an unknown quantity at this point
Re: Two Axis Cameras

Quote:
Originally Posted by Johnbot View Post

Do you need to instantiate two AxisCameras on your cRIO? What do you need to do that for?
We wanted to instantiate two Axis Cameras so we could use stereoscopic vision to tell the distance to the target (stereoscopic vision requires two cameras).

I talked with the rest of my team and we decided to just pull all the image processing off onto a different board like a raspberry pi, bypassing the CRIO.
Thanks for all your help
Reply With Quote
  #8   Spotlight this post!  
Unread 18-01-2013, 18:43
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Two Axis Cameras

Quote:
Originally Posted by mls0.5 View Post
We wanted to instantiate two Axis Cameras so we could use stereoscopic vision to tell the distance to the target (stereoscopic vision requires two cameras).
The Vision Processing paper gives a method to determine distance to the goals that does not require stereoscopic vision. What algorithm for stereoscopic vision were you planning to use?
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 09:50.

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