Lego Mindstorm Example

From Intrument Element Wiki

Jump to: navigation, search

This page describes how to use the Instrument Element architecture. The Lego Mindstorm NXT robotics tool kit is used for this purpose. The Lego Mindstorm NXT comes with a small computing device that is capable of executing codes written in several different programming languages. In this case, Java has been used.


The fun part

The first step is to assemble the Lego Mindstorm NXT robot however one may wish. But depending on the physical structure and configuration of the robot, the software code needs some small modification. In this example, we have used a modified model of Lego Mindstorm NXT that has a pair of tracked wheels operated with two separate motors, a touch sensor, an ultrasonic sensor and a light sensor.

Installing Lejos

The "not so fun part" is to install LeJOS in the Mindstorm NXT brick. But be warned, doing so will remove the existing firmware that comes with the brick. The following links may help:

Setting up IE in a computer

Check out the software from SVN (module tinyIE) in your working environment Info about our SVN:

A suggestion on how to set up your eclipse (just in case):


Pluging in an instrument

Once LeJOS is successfully installed in the Mindstorm NXT brick, it is time to program the NXT brick using LeJOS libraries.

This following is an UML oriented guide on how to plug a new instrument: How_to_plug_a_new_Instrument

Javadoc of the object that you have to implement:

Key classes:

Hello word example:

Using the IE

Done! Web APIs have been implemented and the service is exposed using the IE WSDL. All you have to do is to use them. At your http://yourTomcatUrl/yourAppName/ you can already find a (very basic) GUI that uses the service.

link to the WSDL:

link to the Javadoc related to the Service methods:

link to a UML oriented documentation:


example of how to access the WS APIs from Java:


The real fun

Have fun with the robot! :-)

Personal tools