Go to Post FIRST is all about working with others. - briholton [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

 
 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 24-02-2014, 23:03
ayang548 ayang548 is offline
Registered User
FRC #3663
 
Join Date: Feb 2014
Location: Snohomish,WA
Posts: 3
ayang548 is an unknown quantity at this point
Apparent Infinite Loop When Calling AxisCamera.getInstance()

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
Reply With Quote
 


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 12:47.

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