Lejos & JfuzzyLogic Package

Post your NXJ projects, project ideas, etc here!

Moderators: roger, 99jonathan, imaqine

Lejos & JfuzzyLogic Package

Postby msafin » Fri Apr 13, 2012 5:20 pm

Hi all,

Does Lejos allow the usage of external packages. I am getting a link error while trying to use the package. Any help or insight would be greatly appreciated.

Thank you
msafin
New User
 
Posts: 4
Joined: Fri Apr 13, 2012 5:16 pm

Re: Lejos & JfuzzyLogic Package

Postby skoehler » Fri Apr 13, 2012 5:43 pm

What's the output of the linker?

In general, on the NXT, only a subset of the Java API is available. The jFuzzaLogic package is almost certainly using some APIs that are part of a normal full grown JDK, but not available on the NXT.
skoehler
leJOS Team Member
 
Posts: 1115
Joined: Thu Oct 30, 2008 4:54 pm

Re: Lejos & JfuzzyLogic Package

Postby msafin » Sun Apr 15, 2012 3:37 pm

Hi,

Here is the output of the linker -

Code: Select all
Linking ...
js.tinyvm.TinyVMException: Class java.io.FileReader (file java/io/FileReader.class) not found in CLASSPATH C:\\Program Files\\leJOS NXJ\\lib\\nxt\\classes.jar;C:\\Users\\msafin\\workspace\\RoboFLC\\bin;C:\\Users\\msafin\\workspace\\RoboFLC\\lib\\jFuzzyLogic_v2.1.jar
at js.tinyvm.ClassRecord.getClassRecord(ClassRecord.java:855)
at js.tinyvm.ClassRecord.storeReferredClasses(ClassRecord.java:394)
at js.tinyvm.Binary.processClasses(Binary.java:381)
at js.tinyvm.Binary.createFromClosureOf(Binary.java:309)
at js.tinyvm.TinyVMTool.link(TinyVMTool.java:97)
at js.tinyvm.TinyVMTool.link(TinyVMTool.java:48)
at lejos.pc.tools.NXJLink.start(NXJLink.java:134)
at lejos.pc.tools.NXJLink.run(NXJLink.java:101)
at lejos.pc.tools.NXJLink.start(NXJLink.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at lejos.pc.tools.ToolStarter.startTool(ToolStarter.java:31)
at lejos.pc.tools.NXJLink.main(NXJLink.java:28)
Linking the file failed with exit status 1
Last edited by msafin on Sun Apr 15, 2012 3:57 pm, edited 2 times in total.
msafin
New User
 
Posts: 4
Joined: Fri Apr 13, 2012 5:16 pm

Re: Lejos & JfuzzyLogic Package

Postby msafin » Sun Apr 15, 2012 3:38 pm

skoehler wrote:What's the output of the linker?

In general, on the NXT, only a subset of the Java API is available. The jFuzzaLogic package is almost certainly using some APIs that are part of a normal full grown JDK, but not available on the NXT.



Is there way that I can still use it on the NXT?
msafin
New User
 
Posts: 4
Joined: Fri Apr 13, 2012 5:16 pm

Re: Lejos & JfuzzyLogic Package

Postby skoehler » Sun Apr 15, 2012 4:22 pm

Well, the jfuzzylogic package seems to use the FileReader class, which is not available in leJOS.
You can take the source of the jfuzzylogic package, and try to remove all references to non-existent API in order to compile it for leJOS.
skoehler
leJOS Team Member
 
Posts: 1115
Joined: Thu Oct 30, 2008 4:54 pm

Re: Lejos & JfuzzyLogic Package

Postby msafin » Sun Apr 15, 2012 4:58 pm

skoehler wrote:Well, the jfuzzylogic package seems to use the FileReader class, which is not available in leJOS.
You can take the source of the jfuzzylogic package, and try to remove all references to non-existent API in order to compile it for leJOS.


If I use Bluetooth to remotely run the code on my PC. Would it work then.
msafin
New User
 
Posts: 4
Joined: Fri Apr 13, 2012 5:16 pm

Re: Lejos & JfuzzyLogic Package

Postby skoehler » Sun Apr 15, 2012 5:26 pm

msafin wrote:
skoehler wrote:Well, the jfuzzylogic package seems to use the FileReader class, which is not available in leJOS.
You can take the source of the jfuzzylogic package, and try to remove all references to non-existent API in order to compile it for leJOS.


If I use Bluetooth to remotely run the code on my PC. Would it work then.

Yes. But remotely controlling the NXT from the PC has several drawbacks like a high latency.
skoehler
leJOS Team Member
 
Posts: 1115
Joined: Thu Oct 30, 2008 4:54 pm

Re: Lejos & JfuzzyLogic Package

Postby matthias » Mon Apr 16, 2012 2:06 pm

When only sending simple Tasks - and not controlling Motors remotely this latency is not feelable.

you can for example send commands like: Travel 20.0, Rotate 30 and it will be executed REALLY fast.
But when invoking the Pilot class from the PC the latency makes the Robot VERY slow and VERY inaccurate.

(You first of course need to implement the NXT-Programm, that waits for such commands)
matthias
New User
 
Posts: 20
Joined: Thu Mar 22, 2012 11:44 am


Return to NXJ Projects

Who is online

Users browsing this forum: Google [Bot] and 2 guests

more stuff