Go to Post We're college students. We appreciate free. - Billfred [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-01-2013, 17:21
Rambunction Rambunction is offline
Registered User
FRC #4330
 
Join Date: Jan 2013
Location: St. Louis
Posts: 5
Rambunction is an unknown quantity at this point
Cannot create an RGBImage instance

Right now our robot doesn't have a camera on it so we're trying to run a local program with the wpilibj libraries. We're loading an image taken from last year onto the program but we can't get it to do anything. We simplified the code down to just the declaration:
Code:
new RGBImage();
Which results in this error:
Code:
Exception in thread "main" java.lang.ExceptionInInitializerError
	at edu.wpi.first.wpilibj.image.Image.<init>(Image.java:24)
	at edu.wpi.first.wpilibj.image.ColorImage.<init>(ColorImage.java:16)
	at edu.wpi.first.wpilibj.image.RGBImage.<init>(RGBImage.java:20)
	at localapp.Optical.main(Optical.java:33)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to com.sun.squawk.Address
	at com.sun.squawk.NativeUnsafe.getInt(NativeUnsafe.java:340)
	at com.sun.squawk.NativeUnsafe.getUWord(NativeUnsafe.java:360)
	at com.sun.squawk.NativeUnsafe.getObject(NativeUnsafe.java:404)
	at com.sun.squawk.NativeUnsafe.getAddress(NativeUnsafe.java:414)
	at com.sun.squawk.GC.getKlass(GC.java:1077)
	at com.sun.cldc.jna.Pointer.createStringBuffer(Pointer.java:402)
	at com.sun.cldc.jna.TaskExecutor.<init>(TaskExecutor.java:105)
	at com.sun.cldc.jna.TaskExecutor.<init>(TaskExecutor.java:116)
	at edu.wpi.first.wpilibj.image.NIVision.<clinit>(NIVision.java:29)
	... 4 more
Java Result: 1
What are we doing wrong here?
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2013, 16:34
apples000's Avatar
apples000 apples000 is offline
Registered User
no team
 
Join Date: Mar 2012
Rookie Year: 2012
Location: United States
Posts: 222
apples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant futureapples000 has a brilliant future
Re: Cannot create an RGBImage instance

This seems to be a problem with the squawk VM not being able to work with the hardware. If I understand your post correctly, you're trying to run this on a computer. The exception says that a string cannot be cast to an address, and it seems that an address has to do with lower level communication to peripherals and some of the primitive data types. The squawk VM is not designed to be run on the computer, so when java tries to allocate some block of memory for your empty image and it uses the address class to access the memory, it fails to do so. Ifyou want to experiment with image pprocessing, you can use vision assistant.
Reply With Quote
Reply


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 11:45.

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