Log in

View Full Version : Yet another camera issue


adamdb
04-02-2010, 20:23
We are using Java, but I don't think it is a Java issue so I am posting this in the "general" programming category.

We are trying to do a very simple program to drive the robot and see an image on the classmate from the camera. I am reasonably certain that the camera is configured correctly, and I am confident we have the right firmware (v19) on the cRIO.

Our program is pretty simple:

public class RobotTemplate extends IterativeRobot
{
AxisCamera cam;
RobotDrive drive;
Joystick joy;

/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit()
{

System.out.println("init()");

// Setup camera
cam = AxisCamera.getInstance();
//cam.writeResolution(AxisCamera.ResolutionT.k320x24 0);
//cam.writeBrightness(0);

// Setup drive system components
drive = new RobotDrive(1, 2);
joy = new Joystick(1);
}

/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic()
{
Watchdog.getInstance().feed();

}

/**
* This function is called periodically during operator control
*/
public void teleopPeriodic()
{
Watchdog.getInstance().feed();

double rot = this.joy.getAxis(Joystick.AxisType.kX);
double fwd = -1.0 * this.joy.getAxis(Joystick.AxisType.kY);

this.drive.arcadeDrive(fwd, rot);

Timer.delay(0.005);

}
}


And the error we are getting is the following. The error is at the bottom, but I am including the whole build/deploy/run just in case it suggests anything to anyone.

init:
init:
No to.jar.file specified.
Using "suite/SimpleCamera_1.0.0.jar"
clean:
Created dir: /home/adam/Dev/workspaces/FIRST/SimpleCamera/build
Compiling 1 source file to /home/adam/Dev/workspaces/FIRST/SimpleCamera/build
compile:
Created dir: /home/adam/Dev/workspaces/FIRST/SimpleCamera/j2meclasses
preverify:
Created dir: /home/adam/Dev/workspaces/FIRST/SimpleCamera/suite
Building jar: /home/adam/Dev/workspaces/FIRST/SimpleCamera/suite/SimpleCamera_1.0.0.jar
jar-app:
Using "suite/SimpleCamera_1.0.0.jar"
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
[translating suite image [closed: false, parent: squawk] ...]
### Excluding compile: com.sun.squawk.Method::getParameterTypes
### Excluding compile: com.sun.squawk.SymbolParser::getSignatureTypeAt
Romizer processed 113 classes and generated these files:
/home/adam/Dev/workspaces/FIRST/SimpleCamera/image.sym
/home/adam/Dev/workspaces/FIRST/SimpleCamera/image.suite
/home/adam/Dev/workspaces/FIRST/SimpleCamera/image.suite.metadata
/home/adam/Dev/workspaces/FIRST/SimpleCamera/image.suite.api
Expanding: /home/adam/Dev/workspaces/FIRST/SimpleCamera/suite/SimpleCamera_1.0.0.jar into /home/adam/Dev/workspaces/FIRST/SimpleCamera/suite
Moving 1 file to /home/adam/Dev/workspaces/FIRST/SimpleCamera/suite
Moving 1 file to /home/adam/Dev/workspaces/FIRST/SimpleCamera/suite
Moving 1 file to /home/adam/Dev/workspaces/FIRST/SimpleCamera/suite
Deleting: /home/adam/Dev/workspaces/FIRST/SimpleCamera/image.suite.api
Connecting FTP @10.15.83.2
upgrade:
Sending local file image.suite
flashapp:
deploy:
init:
Setting up for RUN
[cRIO]
Waiting for prompt "-> "
[cRIO] ->
[cRIO] -> xdelete "/ni-rt/system/SQUAWK_DEBUG_ENABLED"
[cRIO] deleting file /ni-rt/system/SQUAWK_DEBUG_ENABLED
[cRIO] /ni-rt/system/SQUAWK_DEBUG_ENABLED: S_relFsLib_FILE_NOT_FOUND
[cRIO] value = -1 = 0xffffffff
[cRIO] ->
Waiting for cRIO to reboot (1s)
Waiting for cRIO to reboot (2s)
Waiting for cRIO to reboot (3s)
Waiting for cRIO to reboot (4s)
Waiting for cRIO to reboot (5s)
Waiting for cRIO to reboot (6s)
Waiting for cRIO to reboot (7s)
Waiting for cRIO to reboot (8s)
Waiting for cRIO to reboot (9s)
[cRIO] ->
[cRIO] -> * Loading StartupDlls: debug
[cRIO] Entering debug.o StartupLibraryInit
[cRIO] Debugging is up, target server mounted at /tsfs
[cRIO]
[cRIO]
[cRIO] VxWorks
[cRIO]
[cRIO] Copyright 1984-2006 Wind River Systems, Inc.
[cRIO]
[cRIO] CPU: MPC5200 -- Wind River Lite5200 BSP.
[cRIO] Runtime Name: VxWorks
[cRIO] Runtime Version: 6.3
[cRIO] BSP version: 2.0/10
[cRIO] Created: Jul 29 2009, 13:41:47
[cRIO] ED&R Policy Mode: Deployed
[cRIO] WDB Comm Type: WDB_COMM_END
[cRIO] WDB: Ready.
[cRIO]
[cRIO] Leaving debug.o StartupLibraryInit
[cRIO] * Loading StartupDlls: NiRioRpc
[cRIO] * Loading StartupDlls: niorbs
[cRIO] * Loading StartupDlls: NiViSrvr
[cRIO] * Loading StartupDlls: nivissvc
[cRIO] task 0xee4118 (PAL00fb54b8) deleted: errno=0 (0) status=0 (0)
[cRIO] NI-RIO Server 3.2 started successfully.
[cRIO] task 0xc5f520 (NiRioRpc) deleted: errno=0 (0) status=0 (0)
[cRIO] * Loading StartupDlls: nivision
[cRIO] * Loading StartupDlls: niserial
[cRIO] * Loading StartupDlls: FRC_FPGA
[cRIO] * Loading StartupDlls: FRC_NetworkCommunication
[cRIO] FRC_NetworkCommunication was compiled from SVN revision 2064
[cRIO] FPGA Hardware GUID: 0xAD9A5591CC64E4DF756D77D1B57A549E
[cRIO] FPGA Software GUID: 0xAD9A5591CC64E4DF756D77D1B57A549E
[cRIO] FPGA Hardware Version: 2010
[cRIO] FPGA Software Version: 2010
[cRIO] FPGA Hardware Revision: 1.3.0
[cRIO] FPGA Software Revision: 1.3.0
[cRIO] * Loading StartupDlls: FRC_JavaVM
[cRIO] task 0x1d7f5c8 (t2) deleted: errno=0 (0) status=0 (0)
[cRIO]
[cRIO] NI-VISA Server 4.5 started successfully.
[cRIO] task 0xe628e0 (t1) deleted: errno=1835009 (0x1c0001) status=1 (0x1)
[cRIO]
[cRIO]
[cRIO] [OTA Server] Version: 2010 FRC, Dec 30 2009, 15:22:08
[cRIO]
[cRIO] [OTA Server] Starting...
[cRIO]
[cRIO] [OTA Command Server] In serverSocketListener()
[cRIO]
[cRIO] [OTA Redirector] In serverSocketListener()
[cRIO]
[cRIO]
[cRIO] Welcome to LabVIEW Real-Time 8.6.1f2
[cRIO] [OTA Server] Restarting Java VM
[cRIO]
[cRIO] [Squawk VM] Starting up...
[cRIO]
[cRIO]
[cRIO] [Squawk VM] Version: 2010 FRC, Jan 11 2010, 23:01:10
[cRIO]
[cRIO] [Squawk VM] File SQUAWK_DEBUG_ENABLED not found, starting squawk in normal mode...
[cRIO] [Squawk VM] arg: squawk.out
[cRIO] [Squawk VM] Squawk command line file SQUAWK_CMD_LINE not found, using default args...
[cRIO] [Squawk VM] arg: -suite:robot
[cRIO] [Squawk VM] arg: -Xmxnvm:1M
[cRIO] Bootstrap suite loaded
[cRIO] In Startup
[cRIO] Looking for implementation class com.sun.squawk.platform.posix.vxworks.natives.Sele ctImpl
[cRIO] Looking for implementation class com.sun.squawk.platform.posix.vxworks.natives.LibC Impl
[cRIO] FPGA Hardware GUID: 0xad9a5591cc64e4df756d77d1b57a549e
[cRIO] FPGA Software GUID: 0xad9a5591cc64e4df756d77d1b57a549e
[cRIO] IterativeRobot Constructor Start
[cRIO] IterativeRobot Constructor Finish
[cRIO] IterativeRobot startCompetition() Start
[cRIO] init()
[cRIO]
[cRIO] Squawk VM caught signal 10
[cRIO] CRASH
[cRIO] si_code: 0x7c6802a6
[cRIO] si_value.sival_int: 0x7c7043a6
[cRIO] In callout to native function: 211d42c
[cRIO] named: AxisCameraStart
[cRIO] Resuming system signal handler...
[cRIO]
[cRIO] data access
[cRIO] Exception current instruction address: 0x00198f84
[cRIO] Machine Status Register: 0x0000b032
[cRIO] Data Access Register: 0x6f787acc
[cRIO] Condition Register: 0x88224444
[cRIO] Data storage interrupt Register: 0x42000000
[cRIO] Task: 0x21727d0 "SquawkRobotTask"
[cRIO] 0x21727d0 (SquawkRobotTask): task 0x21727d0 has had a failure and has been stopped.
[cRIO] 0x21727d0 (SquawkRobotTask): fatal kernel task-level exception!


If I comment out the "cam = AxisCamera.getInstance();" line, everything works fine and we can drive the robot as expected.

I don't think it is the environment as we have built and downloaded this same code to the robot with 3 different PCs, two running Windows (one was the Classmate) and one running Linux. We always get the same result, and I get the same result if I try to use the CircleTrackerDemo program.

We are using an Axis M1011 as our 206 from last year disappeared.

It looks like maybe the cRIO is missing a needed library or something, but I can't figure out where it might be.

Thanks

Kingofl337
05-02-2010, 01:08
Are sure that model is compatible with the code? The code is very specific in how it talks to the 206 if the api is different it will be a no go. I assume you have the IP setup correctly, and a FRC/FRC admin account, and both leds are lit in the crio port two?

Joe Ross
05-02-2010, 09:27
Are sure that model is compatible with the code? The code is very specific in how it talks to the 206 if the api is different it will be a no go. I assume you have the IP setup correctly, and a FRC/FRC admin account, and both leds are lit in the crio port two?

And you also would need to set it to mjpeg, I think it defaults to something else.

adamdb
05-02-2010, 09:38
From other posts, I do think the M1011 is compatible. It is also the one listed on the Axis website as the replacement for the discontinued 206.

I'll check the MJPEG setting again, but I think that is what it was set to.

Is there any chance I am missing some needed library on the cRIO? We reflashed the cRIO with the Java image and it completed successfully, so I don't know of any other way to put a library on it.

I'll see if I can find the source for the AxisCamera libraries and see if that suggests something.

adamdb
05-02-2010, 20:32
Here is the relevant bit of the code from AxisCamera.java:

/**
* Get a reference to the AxisCamera, or initialize the AxisCamera if it
* has not yet been initialized.
* @return A reference to the AxisCamera.
*/
public static synchronized AxisCamera getInstance() {
if (m_instance == null) {
m_instance = new AxisCamera();
}
return m_instance;
}
private static final Function cameraStartFn = NativeLibrary.getDefaultInstance().getFunction("AxisCameraStart");



The error occurs on the "getFunction("AxisCameraStart")" which is a call to some "NativeLibrary". Which again leads me to believe that somehow a necessary library is not on the cRIO or not being included in the project build. But I am creating the project using the normal New Project->FRC->IterativeRobot thing to create the framework. Do I need to modify the project somehow to include some external or extra library for the camera?

Everything that we have tried except for the camera is working fine.

It's a good thing I don't have much hair left, or I might have pulled it out by now. :rolleyes:

adamdb
07-02-2010, 00:59
Despite having checked at least a half dozen times to make sure my Netbeans had all the updates, the following updates were available when I checked tonight:

FRCRobotTemplates v1.17
FRCSquawkSDK 3.37

When I applied these and recompiled the code, it is working and we are seeing the camera image on the Classmate as expected.

The only configuration we did to the Axis M1011 camera was to set up the FRC account, so I can report that it seems to work fine (so far) as well.

I'm not sure when those particular updates were posted, but I am curious as to why I didn't see them until tonight. I do have Netbeans configured to check for updates on every startup. Maybe I wasn't always connected to the internet when I started Netbeans or something.

So, I guess the moral of the story is to make sure you have all the latest stuff! :o

boya3706
07-02-2010, 14:45
Where did you find these updates? Netbeans? Sunspot? They fixed the IterativeRobot Camera code issues?
I know that there were C++ updates posted from WPI on Wednesday to fix the camera code, and we have been patiently waiting for Java updates to fix ours.....
Our problem with the camera and IterativeRobot is that it only sees the target up to 20 feet away max. SimpleRobot will see the target up to 53 feet away (length of the room, so may be further).

ideasrule
07-02-2010, 15:31
Where did you find these updates? Netbeans? Sunspot? They fixed the IterativeRobot Camera code issues?
I know that there were C++ updates posted from WPI on Wednesday to fix the camera code, and we have been patiently waiting for Java updates to fix ours.....

Have you checked in the "Updates" section of Tools-->Plugins?

jault
07-02-2010, 15:36
My team is also trying to use the axis m1011-w camera. We are using windriver/c++ and have the cRIO with the latest version. We can get a picture on our dashboard when we deploy our code, but when we click enable to begin driving the robot, the robot disables itself after 5 seconds.

This problem did not occur with our old axis 206 camera(which is now broken), we are using the same code, configured the new cameras IP already and created the FRC/FRC admin account on it.

Any suggestions on why our camera is disabling our robot??

boya3706
07-02-2010, 15:45
Have you checked in the "Updates" section of Tools-->Plugins?

See, but Updates section of what web page? I've checked FIRST, WPI, both forums, Think Tank, and none of those sections have an Updates-Tools-Plug ins. I was asking where the updates are located....... very specifically, please include a link. I've searched for FRCSquawkSDK 3.37 and the only reference to that on the internet is Chief Delphi.

Joe Ross
07-02-2010, 17:07
See, but Updates section of what web page? I've checked FIRST, WPI, both forums, Think Tank, and none of those sections have an Updates-Tools-Plug ins. I was asking where the updates are located....... very specifically, please include a link. I've searched for FRCSquawkSDK 3.37 and the only reference to that on the internet is Chief Delphi.

Not a website, in netbeans itself. Assuming you configured netbeans properly, you should be getting plugin updates.

adamdb
07-02-2010, 20:04
In the Tools->Plugins->Settings tab make sure that the Check Interval is set to "Every Startup" and make sure you are connected to the internet when you start Netbeans. I think I had mine set on the once a day option and apparently was connected to the internet when it checked for updates.

Don't know if it makes a difference, but we are using the M1011, not the M1011-w (wireless?) camera. I have played with it quite a bit today and have not had any issues. The only configuration we did was to the login accounts as directed.

AlftanSr
19-02-2010, 09:31
Updating instructions are here http://first.wpi.edu/FRC/frcjava.html

That will take you to here:

http://first.wpi.edu/FRC/java/netbeans/update/

Make sure you download the most up-to-date files! For some odd reason, they're not in the default directory. You'll have to navigate to the 'image v20' directory, download the *.nbm files, copy them to your java computer, select tools>update or something (away from our netbeans right now, so can't be too specific), and you're done.

We had an issue where, when we tried to deploy the code to the robot, it said, ''cannot connect to OTA server''. I had to uninstall the plug-ins, and then reinstall them

Such is the life of a non-Internet connected development station...

team1512
26-05-2010, 09:08
AXIS CAM HELP

We need someone who would be willing to advise us in working our AxisCam with JAVA code. We have been attempting to program it all Spring to no avail. We have gotten as far as giving the camera an IP address, but cannot configure the Java code to show the image on a screen. Any and all help is greatly appreciated.
Team 1512