View Single Post
  #6   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