Core Lego Mindstorms Programming
The Mindstorms kit is for those people who have always wanted to play with robots, but couldn't find any time between work and home. In short, its a kit tailor made for programmers, not for those people with Mensa level IQs who know how to build an H-bridge circuit or a voltage regulator from scratch. Probably the easiest and most understood programming language right now is Java, and that is the language this book focuses on. The book introduces leJOS, which is a Java Virtual Machine (JVM) and operating system rolled into one. It's the first JVM I've seen to run in the tiny space of only 32kb. As lore has it, back when Java was known as "Oak," it was meant as a language to program small appliances such as remote controls, microwaves, televisions, VCRs and other household electronics. In all that time I've never seen Java actually used in such small devices until now.
This book starts out slowly, for people who are just cracking open the box. It gives a complete, in-depth overview of the hardware, as well as the included software -- which the author basically advises you toss away if you have any interest in serious robot programming. Surprisingly (or perhaps not surprisingly) the tiny RCX brick contains as much horsepower as the on-board computers for the Apollo moon missions. The brick contains 32kB of RAM, which seems small at first but when you realize the memory older computers like the Apple II and TRS-80 had, this is an ample amount. Some of those older games had a lot going on in terms of AI and graphics, so for robot applications without graphics it's a lot of memory. In the spirit of Bill Gates, 32kB should be enough for anybody. There are also some good (though prohibitively costly) third-party sensors that, if you owned them all, would give you most of the sensing abilities that old Spock had with his tricorder.
leJOS is a product of Sourceforge, and quite popular. The leJOS language, which is essentially Java with some cut-backs, is covered in depth. It has most of the features of the real Java language, barring object reflection and garbage collection. I haven't heard of any official "smallest JVM" contest but if there was one I'm sure leJOS would be one of the contenders. It definitely surpasses Sun Microsystems J2ME in the micro category. Setup is fairly straight forward and the author even includes a free IDE that works great with the leJOS.
Once past the introductory material, the book contains some truly interesting projects. In a way, the book is similar to the general robotics book Mobile Robots: Inspiration to Implementation (Jones, Seiger, Flynn), except it's for the Mindstorms crowd. There are many robots to build, including a wall-following robot, a robot that navigates with a real compass, a robot you can control from a web page, and some surprisingly in-depth hacking tricks. Unlike books which only give suggestions on how to build robots, this book includes complete building instructions and code listings for every project. The fact that Lego parts and RCX bricks (the processing center of a Lego Mindstorms robot) are identical to each other allows this to be possible. It contains not just 'how to' information, but expands into robot theory as well. Books such as Mobile Robots have to be general and ambiguous at times because the authors don't know what kind of parts a reader will be able to obtain. In a way, this is the genius of Lego Mindstorms - the ability for people to pass robot recipes to one another.
The final two chapters really kick the leJOS language into overdrive. These sections are where geeks thrive. Chapter 11 deals with connecting the RCX brick to the Internet. Apparently the leJOS language has built in classes for sending data, and even a handy Java bean that's useful for embedding JSP web pages. These projects are described down to the last detail, including showing how to set up a free Resin server to serve the web pages. Unfortunately the author does not take the time to explain much of anything with JSP, so beyond his JSP examples you may not get very far. Readers will be forced to look elsewhere if they want to learn more about JSP.
The final chapter really goes hard core. It contains some so-so information about how to hack leJOS, changing classes or removing methods to save memory. The real kicker is a feature of the leJOS JVM I was not aware of: leJOS is capable of running almost ANY language. Apparently even the official JVM is capable of running a multitude of third-party developed languages, including Fortran, C, and weird custom languages such as IBM's NetRexx. All that's required are the development tools to compile the source code into Java bytecode, and these compilers exist in abundance. There are no fewer than 100 such available languages, all free for the downloading.
Illustrations in the book are frequent and helpful, but somewhat plain. Usually they consist of line drawings without much artistic merit. The 3-D renders of the robots are exceptional, however. Each step in building the robots has been rendered, making the Lego parts very easy to see. The steps are well laid out, and the new parts for each step are suspended in the corner and labelled. Thankfully, all models in the book can be built with any version of the Robotics Invention System kit.
If you are a programmer who has an impulse to experiment with robots, but don't want to get solder on your fingers building from scratch, this book will get you to where you want to go. And if you do want to get some solder burns, there's even a few projects in here just for you. Overall the book is a joy to read. The author obviously loves robotics and his enthusiasm shows on every page. The tone is loose but contains a lot of detail presented in an easy-to-digest manner. If you want to dabble in robotics then Lego Mindstorms is the easiest way to do it and having this book is a good way to get started.
You can purchase Core Lego Mindstorms at bn.com. You can read your own book reviews in this space by submitting your reviews after reading the book review guidelines.
A couple years back, before all the robot fighting shows started popping up, I decided that I wanted to get into robotics to enhance my art projects. I searched everywhere for books and relevant information, but all I found was extremely basic kids books that didn't really tell me anything useful or extremely complex stuff on "muscle wires" and the like. I found there wasn't much of a middle-ground and soon I was onto something else. It appears as though the scene has changed a bit, how much will Lego Mindstorms help me in learning how to create more complex interactive robots?
sig.
Remember that scene in 'The Fifth Element' where all the cute little robots come out of the wall and clean up the broken glass, well I wonder how much trouble it would be to say create a couple of specialty mindstorm bots to do this on command (obviously not environment reactive, but event driven is good enough for me) Hook up a small broom and dustpan to one, hook one up to my vacuum and `viola! I'll never do housework again :)
Here's Sun's article on this. Apparently, they managed to squeeze a JVM with multithreading (although no garbage collection) into 16K. Who said Java was big and bloated? :-)
A funny quote:
The robot that they built for the International Space Station, called Jitter, floats around collecting particles of debris. So even though it doesn't have a garbage collector, it is one!
maybe /. should sponsor a MindStorm-athon. A bunch of geeks in the room, 24 hours and lots of caffiene. I'm sure Lego could be convinced to donate the lego's, since they could take those robots and use them for PR and other marketing related uses.
check out
http://www-theory.dcs.st-and.ac.uk/IC_Group/resour ces/software/software.shtml
- for the software
and
http://www-theory.dcs.st-and.ac.uk/IC_Group/resour ces/multimedia/multimedia.shtml
for cool movies and videos of the lego robot.
Various different types of learning were played around with ; neural, reinforcement learning , handcoded algorithms....
Those pages are still to be ok'd with my local dept. though, so please email gbb@dcs.(nospam).st-and.ac.uk if you have any questions about them.
Take your Mindstorms set to a local school, gather a group of geeks-in-training, and join the First Lego League. The challenges are complex and fun, and it sounds like the programming information and tips in the book would lead to some really great robots.
Best of all, you will be helping kids see that computers can be used for more than just video games and IM.
The vacuum cleaner is one idea. The book and mass production hints of lower costs to produce the materials. We could expect these products to reach everyday uses soon.
The other day while at the hardware store there is one familar brand of sprinklers. The brand name is LEGO. Cool. Horticulture is one area we could use some low cost robotic smarts. One reason is to conserve water with the equipment that is smarter than the simple six relay timer. Another idea is the sprinkler itself with more smarts. Could program sprinklers to spray in square shapes, ovals, half cones, or thin and long rectangles instead of circles. Could have the sprinklers spray lighty on one side and heavy on the other side.
This is representative of robotics in general. Robots are notoriously BAD at knowing where they are in the real world, or exactly how far they have moved. That's why NASA had a lander and a rover in the Mars Pathfinder mission. The lander had a pan and scan stereo camera that could pretty accurately measure the rover's relative position from the lander (IIRC, cameras were accurate to about 5mm at 5m, but I'd have to review my notes). Without an external view, NASA would have quickly lost the rover - in one sequence of commands, the error in where the rover ended up from where it was commanded to go was as large as the distance it was supposed to move!
One way (I think, anyway) to get around this is to have many rovers all talking to each other and to the lander. Robots are good at sending relative positions, but bad at determining absolute position. So you get each robot to stay in constant contact w/2 other robots, and deterime their positions relative to itself. As long as one robot stays in constant contact with the lander, the lander can do some simple vector math and determine the positions of all the other robots! This would be cool because you can string out the robots in a long line, and you can safely move robots outside of the visual range of the lander. I wrote about it in my thesis.