Question

We have a project in which we want to control a Lego Mindstorms robot with the Microsoft Kinect sensor. We decided to use SimpleOpenNI with Processing to read the sensor and leJOS to control the robot for a simple reason: since both is in Java, we can specifiy a kind of RoboHandler and call its methods from the sensor reading class.

In order to achieve that, we downloaded the leJOS plugin for eclipse, created a new leJOS NXT project and put the processing and SimpleOpenNI libraries in the build path. Note that to use SimpleOpenNI, it is required an old processing version without Java.

Now the problem is, that when installing leJOS, it strictly requires a 32-bit Java JDK, so I had to download this and point to it at installation.

At this point, following build paths are in the project:

  • LeJOS NXT Runtime (which has among others java.awt classes)
  • core.jar (used to run Processing in eclipse)
  • SimpleOpenNI.jar

Having all this, and setting up a first Processing sketch like

import processing.core.*;

public class Test extends PApplet{
    (....)
}

results in following error code:

Multiple markers at this line
    - The type java.awt.event.MouseMotionListener cannot be resolved. It is indirectly referenced from 
     required .class files
    - The type java.applet.Applet cannot be resolved. It is indirectly referenced from required .class files
    - The type java.awt.event.MouseListener cannot be resolved. It is indirectly referenced from required .class files
    - The hierarchy of the type FirstTry is inconsistent
    - The type java.awt.event.FocusListener cannot be resolved. It is indirectly referenced from required .class files
    - The type java.awt.event.KeyListener cannot be resolved. It is indirectly referenced from required .class files

When I downloaded the Processing without Java version, I wasn't able to choose from 32bit- or 64bit version. The SimpleOpenNI is installed as 64bit-version.

When adding the 64bit-JDK (eclipse workspace default) as workspace too, the error disappears, but when trying to run a sketch, following error gets printed in the console:

Invalid layout of java.lang.Thread at name
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (javaClasses.cpp:128), pid=9176, tid=8740
#  fatal error: Invalid layout of preloaded class
#
# JRE version: 7.0_04-b22
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.0-b21 mixed mode windows-amd64 compressed oops)
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Valentino\Desktop\workspaces\workspace_processing\RoboZeugs\bin\hs_err_pid9176.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#

So in my oppinion there is a problem with the JDK versions (32 and 64 bit), but there must be a way to handle this. Has anyone experience on this specific topic, maybe even with Kinect -> Mindstorms? Can anybody tell me what this error exactly means?

No correct solution

OTHER TIPS

You're mixing classes that are designed to run with the JVM on the NXT brick (i.e. everything in classes.jar) with classes that are designed to run with a fully fledged JVM on the PC. Don't do that. If you want to remote control an NXT, use pccomms.jar and everything else in lib/pc. But never add classes.jar or anything else in lib/nxt to the classpath when you're starting a Java program on your PC.

The error message about java.lang.Thread is probably due to the fact, that java.lang.Thread in classes.jar in by no means compatible with java.lang.Thread that comes with the JVM on your PC.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top