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.
You can get the source for the Axis Camera by extracting
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?