What is leJOS NXJ
leJOS NXJ is a Java programming environment for the LEGO
MINDSTORMS NXT ®. It allows you to program LEGO ® robots in Java.
It consists of:
- Replacement firmware for the NXT that includes a Java Virtual Machine.
- A library of Java classes (classes.jar) that implement the leJOS NXJ Application Programming Interface (API)
and provides an alternative Java Runtime (packages java.*) that's optimized for the NXT.
- A linker for linking user Java classes with classes.jar to form a binary file that can be uploaded and run on the NXT.
- PC tools for flashing the firmware, uploading programs, debugging, and many other functions.
- A PC API for writing PC programs that communicate with leJOS NXJ programs using Java streams over Bluetooth or USB, or using the LEGO Communications Protocol (LCP).
- Many sample programs
As leJOS is a firmware replacement, the new leJOS NXJ
firmware must be flashed onto the NXT, and will replace the standard
LEGO MINDSTORMS firmware. This wipes out any files currently held on
the LEGO firmware. The LEGO firmware can be restored using the LEGO
leJOS is an open source project hosted in the sourceforge
repository. It was originally created from the TinyVM project that
implemented a Java VM for the LEGO Mindstorms RCX system. The RCX
version of leJOS proved very popular with the LEGO Mindstorms Robotic
Inventions Systems owners, and close to 200,000 downloads of all
versions of leJOS have been done. The original author of TinyVM and
the RCX version of leJOS was Jose Solorzano.
The NXT has given the leJOS development team the opportunity to greatly expand the capability of leJOS.
Back to top
Advantages of leJOS NXJ
There are many advantages of using leJOS NXJ rather than the NXT-G or other programming environments for the NXT. These include:
Back to top
- It uses the industry-standard Java language.
- It supports object-oriented programming.
- It is an open source project with many contributors.
- It allows you a choice of professional Integrated Development Environments including Eclipse and Netbeans.
- It has plugins for both Eclipse and Netbeans.
- It has cross platform support – Windows, Linux and Mac OS X.
- It is much faster than NXT-G.
- It has full support for Bluetooth, USB, I2C and RS485 protocols.
- It provides highly accurate motor control.
- It support the latest Java 1.7 language features.
- It has advanced navigation support.
- It supports localization including Monte Carlo Localization (MCL).
- It supports other probabilistic robotics algorithms such as Kalman filters.
- It provides Behavior classes that support the subsumption architecture for ease of programming of complex robot behaviors.
- It supports many third party sensors.
- It supports remote logging to the PC over Bluetooth or USB, optionally by redirecting System.out and System.err.
- It supports remote monitoring and tracing of your leJOS NXJ program from the PC.
- It provides floating point Math, trigonometry and other Math functions.
- It supports the JME LCD user Interface including many graphics functions.
- It supports multithreading.
- It supports listeners and events.
- It supports safe memory management with garbage collection.
- It supports standard Java input/output streams over Bluetooth, USB and RS485.
- It has a flash file system accessed by the standard java.io classes.
- It supports data logging and remote capturing of the logs.
- It has sound support including playing 8-bit WAV files.
- It provides dozens of sample programs.
- It supports remote execution of a large subset of the API from the PC.
- The Web site has online forums to help solve any problems you might have, to share projects ideas, and to communicate with the development team.
- It has telerobotics support via standard TCP/IP sockets.
- It supports NXT to NXT Bluetooth and RS485 communications.
- It supports Bluetooth communication with other devices, such as GPS receivers.
- It has support for GPS devices including support for the javax.microedition.location API.
- It supports Bluetooth keyboards that use the Bluetooth Serial Port Profile (SPP).
- It supports two-way communication with RCX via third party adapters such as the Mindsensors NRLink.
- It supports servo motors and Power Function (PF) motors.
- It provides compatibility with Lego Communications Protocol (LCP), so that many tools that work with the standard LEGO firmware, also work with leJOS.
- It has an easy to use menu system.
- It is widely used by universities and other education establishments.
- It has support for simple computer vision applications.