Home / Source
Name Modified Size InfoDownloads / Week
Parent folder
readme.txt 2010-02-10 4.5 kB
becerik.src.tgz 2010-02-10 26.3 kB
Totals: 2 Items   30.8 kB 0
Abstract
--------------------------------
LEGO Mindstorms NXT is a flexible robotics platform that allows different programming approaches for development. In addition to the possibility of programming the robot using a PC based computer, users can also use the robot’s onboard controls to create programs However, NXT’s on-brick programming capabilities are limited in the original firmware in a number of ways.

The original on-brick programming interface of LEGO Mindstorms NXT has a limitation of only allowing 5 steps of operation. Programming the robot to do more than five steps of operation is not possible with the default firmware. Also the on-brick programming menu file defines the program steps in a tree structure. Each step selection submenu is in return a submenu of the previous command selection. LEGO Mindstorms NXT uses hexadecimal number strings of length 8 for menu item identification. Therefore the menu system only allows a depth of 8 submenus and 16 items for any given submenu level.

LeJOS NXJ was chosen as the basis for the new on-brick programming system for a number of reasons. First of all, leJOS NXJ fully supports the LEGO Mindstorms NXT hardware. This includes all the onboard peripherals and official sensors. There is also support for aftermarket sensors such as compass sensor. This wide spectrum of supported devices provides a very capable base. Secondly, leJOS NXJ gives the user the freedom to use Java language for development.

Because of the previously mentioned limitations, we have developed a new on-brick programmer using leJOS platform. Key features of this project are:

    * Multilanguage support: All user interface elements are called from language files with ".lng" extensions. These files can be translated and uploaded to the robot for future language support.
    * Multiple step operation: Users can now program the robot to perform more than 5 steps of operation. Number of steps is only limited by available memory.
    * Sensor support: Our program supports sensors like magnetic compass sensor which is not supported by the original on-brick programmer.


Setup Environment
--------------------------------
In order to execute Java programs, LEGO Mindstorms NXT requires lejOS firmware installed. To do this, please download and install the lateset lejOS NXT for your operating system from http://lejos.sourceforge.net/. After the installation leJOS will prompt you to upgrade your brick's firmware. Proceed and complete the firmware installation.

If you do not wish to compile from source please skip to "Installation" section.

Compiling the code can be done from command prompt but it is recommended to use a IDE like Eclipse. Compiling and running the code can be done from the command line with tools provided with leJOS. However it is generally recommended to use an IDE like Eclipse. Please refer to http://lejos.sourceforge.net/nxt/nxj/tutorial/Preliminaries/CompileAndRun.htm for more information about compling and running leJOS programs.
Installation

Running the binary code can be performed following these steps:

    * Turn on your brick and connect the USB cable
    * Run nxjbrowse located in your leJOS installation folder
    * Upload OBP.nxj
    * Upload .lng files (optional)
    * Close nxjbrowse
    * Enter Files menu on your brick, select OBP.nxj and select execute

It is possible to make the on-brick programmer the default application. By doing this, the brick launches the application without displaying the main menu. Please refer to the documentation for more information.

On-brick programmer requires specific sensors and motors connected to specific ports. It is necessary to connect each sensor and motor to its reserved port for correct operation. If two or more sensor share the same port only one of them can be used while programming the robot. Port mappings are as follows:

    * Ultrasonic distance sensor -> Sensor port 1
    * Sound sensor -> Sensor port 2
    * Light sensor and magnetic compass sensor -> Sensor port 3
    * Touch sensor -> Sensor port 4
    * Left motor -> Motor port B
    * Right motor -> Motor port C

Recommendations and Known Issues
--------------------------------
Magnetic compass sensor is susceptible to electromagnetic interference. It is recommended to mount the magnetic compass sensor away from the motors and the brick.
Future Work

    * Supporting more sensors
    * Implementing Save/Load function
Source: readme.txt, updated 2010-02-10