We have a stripped down version of 2014VisionImageSample Project that is apparently going into an infinite loop when it reaches the AxisCamera.getInstance() call. This is our code:
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.camera.AxisCamera;
public class VisionSampleProject2014 extends SimpleRobot {
AxisCamera camera;
public void robotInit() {
System.out.println("about to be initialized... the camera");
camera = AxisCamera.getInstance();
System.out.println("camera initialization complete");
}
public void autonomous() {
}
public void operatorControl() {
}
}
When the call to AxisCamera.getInstance is made, we can trace the code into the constructor using the debugger.
When cameraStartFn.call1 is called, it never returns (this code is inside AxisCamera.java inside WPILIB)
/**
* Axis camera constructor that calls the C++ library to actually create the instance.
* @param IPAddress
*/
AxisCamera(String IPAddress) {
Pointer ptr = Pointer.createStringBuffer(IPAddress);
cameraStartFn.call1(ptr);
}
Our camera IP address is 10.36.63.100
So when we run the code above we expect to not find the camera because the default address is 10.36.63.11. The code does not find the camera as expected but it never returns and repeats the following error message.
Debugger output with incorrect camera IP address
Established connection to Debugger (handshake took 32700ms)
Excluding compile: com.sun.squawk.SymbolParser::getSignatureTypeAt
Excluding compile: com.sun.squawk.Method::getParameterTypes
[cRIO] about to be initialized… the camera
[cRIO] JavaCameraLib was compiled from SVN revision 2962
[cRIO] camera initialization complete
[cRIO] Default disabled() method running, consider providing your own
[cRIO]
[cRIO]
[cRIO] >>>>ERROR: S_errno_EINPROGRESS (0x00000044): Failed to connect to the camera …in CreateCameraSocket() in C:/WindRiver/workspace/WPILib/Vision/AxisCameraParams.cpp at line 457
[cRIO]
[cRIO]
[cRIO] >>>>ERROR: S_errno_EINPROGRESS (0x00000044): Failed to connect to the camera …in CreateCameraSocket() in C:/WindRiver/workspace/WPILib/Vision/AxisCameraParams.cpp at line 457
[cRIO]
<Error Messages repeat apparently forever>
When we pass in the correct IP address, the error messages go away but the call still never returns.
camera = AxisCamera.getInstance(“10.36.63.100”);
Debugger output with correct camera IP address
Established connection to Debugger (handshake took 2315ms)
Excluding compile: com.sun.squawk.SymbolParser::getSignatureTypeAt
Excluding compile: com.sun.squawk.Method::getParameterTypes
Attached JPDA debugger to localhost:2900
[cRIO] about to be initialized… the camera
[cRIO] JavaCameraLib was compiled from SVN revision 2962
<Output stops>
We’ve repeated this with 2 different cameras and 3 different computers. Does anyone have an idea what is wrong?
Thanks,
Angelique