Lego Mindstorms is a new generation of lego with robotic actuators and basic sensors including light (presumably an LDR), sound (a mic), touch (a simple button switch), and distance (ultrasonic) and later models also include a colour sensor. Also included is the "Intelligent Brick" computer that a user can download programs created on a home computer (Windows or OSX) via USB. The Brick has bluetooth capability, a small monochrome LCD display and a speaker to play sound files. The sound files are a proprietary format, so one has to convert .wav or .mp3 to this format first using downloadable software. The memory included to store programs and sound files is rather a paltry 32K given the costs of flash storage limiting anything too elaborate in the sound department or having too many programs loaded at once. I'm talking perhaps a few programs, one 2 second sound file (8bit) and no more. This memory also stores the brick's firmware.
But it's the software included I'm reviewing, a visual programming environment called NXT.
Tying in with the Lego bricks, the environment uses a brick metaphor the to construct programmes. It's very accessible to a beginner or a child wanting to control any robot he or she may build. Bricks fit together along a line that control's the program flow, and from the start point the programmer can branch out 3 concurrent programs. The toolbox of commands down the side are divided in one of three different ways according to a tab that the user selects. There is a common blocks tab, a complete set tab and a custom tab. The complete set has commands/blocks in groups according to function. The functions are controllers such as motor, display, sound and bluetooth send, sensing commands for the many different ways the robot can sense the environment, program flow such as wait, stop, loop and switch, which the software's conditional statement, data such as logic operations, number comparisons, math, random numbers and variables and an advanced set such as file access, number to text and calibration. The blocks that manipulate data also have control wires that once can pass data back and fourth. The code as far as I can tell cannot branch away to nother part of the program so one must resort to the switch command to make conditions that contain sub programs. While this could get wildly complex and convoluted, the software also allows the user to create entire programs and turn them into custom blocks effectively making subroutines more modular and able to be plugged in for different purposes, mirroring functions in other languages.
The programs are inevitably slower than if one was to attempt to code with a more native or low level language but NXT provides the perfect introduction to a beginner who just wants to get their robot to do something.
However not all is good with the environment. It can get slow to use with large programs and prone to crashing, losing all of your work. It's particularly bad on OSX, so if one has a choice it's a much better idea to use NXT on windows. The environment also lacks some basic user interface elements making the program frustrating to use for not just a power user, but an average user. There are no scrollbars, and the only way one can get around is using the hand tool, for which there is no keyboard shortcut. One has to alternate between the hand tool and the selection tool using the mouse, and that combined with the sometimes slow and crash-prone interface and if one was to have a particularly low resolution screen (and perhaps combined with a deadline for a student project for good measure) makes the experience very unsatisfactory.
Also, documentation is a little poor and it is difficult to debug programs that manipulate data as there is no real way to see what the program is doing. One can possibly get the program to display results onto the screen but aside from that being not as straightforward as it could be one would have to hope that their program's logic works enough to get that far.
NXT is a great way to get started with the Lego Mindstorms kit and programming in general, with more advanced users perhaps moving on to other environments like Java. Aside from lacking basic UI elements such as the mentioned scrollbars, perhaps one is not meant to be still using NXT by the time they encounter some of the issues raised.
No comments:
Post a Comment