Thursday, October 21, 2010

LEGO Mindstorms NXT Robots (leJOS)

Visit the High Level Logic (HLL) Website
— Home of XPL (eXtensible Process Language)

It's like XML, but you can store source code in it.

Being oriented to work on tools and middleware, I allow myself to get enthusiastic when software reaches the stage that it makes something else relatively easy to do. So, I feel no regret posting this comment in advance of a working demonstration. (Something does actually work – read on!)

Creation of a robotics demo for HLL has to this point proceeded with a simple robot simulation. Movement and positions were nothing but numbers fed from the simulation and translated in the browser-based GUI to a colorful circle moving around through two rooms, which were nothing more than a 2D outline. (Only tested on Firefox, so if you're not using Firefox, you might not see the first (dynamic) image of the "robot" moving through the rooms below.)

The High Level Logic (HLL) software system deals with what the name implies - high level logic. It's designed to provide and support high level logic for all kinds of applications. So, motor control and sensor feedback really has nothing to do with working on the HLL core system. Robotics is a good and fun application to work with; and certainly to the point back when a robotics research project was paying for the work.

For 2-3 years now, I've had a LEGO Mindstorms NXT kit that didn't get any attention past trying out Microsoft's (at the time new) Robotics Studio. A friend of mine recently decided not to let it go to waste, and built the first robot by following the instructions in the booklet that came with it.

I've switched computers since last installing the Mindstorms software. The copy that came with the kit did not contemplate 64 bit architecture, so the simple installation from CD didn't work. After googling around a bit, I discovered a good set of instructions to get the job done. (Getting to Grips with Installing, Updating and Programming LEGO Mindstorms Kits.)

Software that came with the kit successfully installed, I checked to see if everything was working. Check, check, check. Now to change everything. What I really want is to create some smart high level logic using HLL and send commands from there to the robot through “experts.”

The focus of my work is on HLL, so I'm not interested (well, maybe I'm interested and it's more a question of time and keeping my efforts focused) in working out all the Bluetooth communication and NXT control code myself. Wouldn't it be nice if someone who had already developed that technology had made it available. And someone did. (Actually, I knew that.)

I installed leJOS NXJ, which includes replacing the firmware on the LEGO Mindstorms NXT brick. Now it's ready to interact with Java programs on my computer – well, not quite.

The installed software for leJOS hadn't contemplated 64 bit architecture either. When trying to run the first sample program, I got error messages telling me it couldn't find libraries like “intelbth_x64”. Luckily, leJOS project contributors did something about that this year and the problem was easy to fix (by replacing the ...\leJOS NXJ\3rdparty\lib\bluecove.jar file that came with the downloaded installation with the latest snapshot. Check here to see if that's still the most recent if you have this problem.)

Magnifique! The first sample program ran. It didn't matter that it only passed a Java program that plays a tune to the brick (which immediately played the tune). This is progress.

So, now you also have an accurate status report on the state of getting a LEGO Mindstorms NXT robot to run with HLL. I haven't hooked it up yet. I haven't yet even delved into the samples that come closer to what I want. But the basics are working, and that's an excellent start.

1 comment:

  1. Moved things from one server to another. SVG not working. It was old anyway. If I have the time, I'll look into it.