The Unofficial Guide to Lego Mindstorms Robots 76
The Unofficial Guide to Lego Mindstorms Robots | |
author | Jonathan B. Knudsen |
pages | 247 |
publisher | O'Reilly & Associates |
rating | 9/10 |
reviewer | Will Ware & Kurt DeMaagd |
ISBN | 1-56592-692-7 |
summary | Get the most out of your Lego Mindstorms |
The Unofficial Guide to Lego Mindstorms Robots
Review by Will Ware
Last year, Lego released their Mindstorms Robotics Invention System. Using this, children and adults can build simple robots whose behavior can be programmed. The Mindstorms system is a major contender for Coolest Toy on the Planet.
The system contains a RCX programmable brick containing an H8/300 microcontroller, some pushbuttons, a little LCD display, and connectors for motors and sensors (light and physical contact). The user writes a program using a graphical programming language on his Windows box, and downloads it to the RCX via infrared.
Not surprisingly, substantial reverse engineering (1, 2) has been done by hobbyists, and it is possible to develop Mindstorms programs on a Linux box and to download the RCX brick from Linux.
Now O'Reilly has joined the Mindstorms fray, with a book full of fun and useful information about how to build and program Mindstorms robots. The book describes four different robots: Hank is a bumper car robot, Trusty uses light sensors to follow a line along the floor, Minerva has a movable arm, and two identical robots play a game called RoboTag. Along the way, the author discusses the physics and mechanics of robots, programming issues, and the available development environments for Mindstorms.
What's Good?
There are detailed building instructions for each of the robots, showing photos at various stages of construction. The designs are simple and appear mechanically sound. There are discussion of the physics and mechanics of tank treads, steering, gears, and other things.The book's chapters sequentially step through several different software development environments. The first chapter starts with the Windows-based RIS environment that comes on the Mindstorms CDROM. Later chapters give programming examples for NQC (Not Quite C), pbFORTH, Visual Basic, and the legOS operating system, which uses an EGCS cross-compiler to target the H8/300. There are more development platforms available, but these give a good sense of what's possible in Mindstorms programming.
The book has dozens of useful URLs, for both official Mindstorm sites and unofficial hobbyist sites. I particularly liked the fact that the author was aware of some of the recent research in robotics. For instance there is some discussion of Rodney Brooks' subsumption architecture, which is used for the RoboTag robots.
Later chapters of the book often expand on designs from earlier chapters, building more sophistocated robots in an accessible, incremental fashion. For the more adventurous hobbyist, the final chapter talks about building your own sensors and actuators, and how to connect them to the RCX.
What's Bad?
Some of the photos are too dark and lack contrast. It would also have been nice if the photography had been in color, but black-and-white photos kept the book more affordable.This book is for the casual weekend robot-building tinkerer, and it never promised to discuss real-time embedded issues in depth. Still, a few topics might have merited at least brief mention. Systems with real-time multitasking must frequently arrange for synchronization and communication between tasks, using mutexes and mailboxes and the like, which brings the possibility of deadlocked processes. Another danger is that an aggressively efficient compiler will sometimes optimize away reads and writes to hardware registers. The fix is to declare such registers with the volatile keyword.
Review by Kurt DeMaagd
While Lego Mindstorms were officially released for a teenage crowd, they have become popular with a wide variety of technically competent people in many age groups. This widespread fascination has opened up a whole new world of opportunities for using Mindstorms. At the same time, the documentation and tutorial included with the Lego kits provide very little information about how to get the most out of the sets. This book fills the void by providing several start-to-finish robot designs, software to run them, and a wealth of other tips and tricks.
After a brief introduction to robotics and how Legos fit in, the author discusses the basics of using Mindstorms to create them. Both chapters present a problem, provide step by step building instructions, provide the necessary information to program the solution, and finally go into greater detail about the Lego features used to solve the particular problem.
While the chapters did an excellent job of presenting this information in general, they fell victim to a problem that would plague the entire book: some of the building diagrams were nigh unto unreadable. Attempting to build a robot based on fuzzy black and white photographs can be quite a chore. Fortunately, none of the robots were so complex that they robots were completely unbuildable.
The first few chapters presented robots programmed with the default RIS programming environment. In chapter four and following, he shows how to program using languages such as Not Quite C, Forth, Sprit.ocx for Visual Basic--or optionally Visual C++ or another ActiveX-aware language--and legOS. Since much of these sections was documenting API's, it was certainly not the most exciting read, but it does provide concise, easily to reference documentation.
Not Quite C, as the name implies, is a C-like language that can be used to program Mindstorms robots. It overcomes many of the limitations of the default RIS programming environment, most notably the lack of variables. One of its biggest advantages is that it does not require the user to install a new version of the firmware on their RCX unit. In general, it provides an excellent balance between power and usability.
The remaining three means of programming presented in the book are fairly mediocre options. PbForth requires the user to download a new firmware version, and the language itself is very archaic in modern software development terms. Using Sprit.ocx is a viable option for people used to programming in Visual Basic or Visual C++, but the control structures are very clunky and non-intuitive. legOS, while it is probably the most powerful option, takes a significant amount of time to set up and develop applications with.
Two of the projects referenced while discussing the various programming languages were particularly interesting, both of which outlined infrared communication. The first program creates a simple remote control for controlling a robot via the IR port on the RCX. The other example, perhaps the most interesting in the book, was creating two robots who played tag with each other. These two robots also communicated with each other via their IR ports.
The last chapter, targetted toward the hard core Mindstorms users outlined how to create additional sensors for Mindstorms. It sketched out such possibilities as a passive light sensor, a Hall effect sensor (magnetic fields), and a touch multiplexor (allowing you to have more touch sensors than normally allowed on the RCS unit).
In general, the book provides a vast array building and programming tips, tricks, and methods. He gives basic information for the person who is just starting, and introduces the advanced user to the vast network of people and product that have made Mindstorms far more than a child's toy.
Purchase this book at fatbrain.
Table of Contents
- Preface
- 1. Welcome to MINDSTORMS
- What is a Robot?
- Mobile Robots
- What is MINDSTORMS?
- What Now?
- Online Resources
- 2. Hank, the Bumper Tank
- About the Building Instructions
- Building Instructions
- A Simple Program
- Wheels
- Bumpers and Feelers
- Gears
- Multitasking
- Online Resources
- 3. Trusty, a Line Follower
- Building Instructions
- Some Tricky Programming
- The Light Sensor
- Idler Wheels
- Using Two Light Sensors
- Online Resources
- 4. Not Quite C
- A Quick Start
- RCX Software Architecture
- NQC Overview
- Trusty Revisited
- Online Resources
- 5. Minverva, a Robot with an Arms
- Building Instructions
- Programming
- Directional Transmission
- Pulleys
- Mechanical Design
- Two Sensors, One Input
- Where am I?
- Online Resources
- 6. PbFORTH
- Replacement Firmware
- pbForth Overview
- About Forth
- pbFORTH Words
- An Expensive Thermometer
- Minerva Revisited
- Debugging
- Online Resources
- 7. A Remote Control for Minerva
- Two Heads are Better Than One
- The Allure of Telerobotics
- Building Instructions
- Programming the Remote Control
- Programming Minerva
- Online Resources
- 8. Using Sprit.ocx with Visual Basic
- You May Already Have Visual Basic
- About Spirit.ocx
- Calling Spirit.ocx
- Immediate and Delayed Gratification
- Programs, Tasks, and Subroutines
- Tips
- Retrieveing the Datalog
- Online Resources
- 9. RoboTag, a Game for Two Robots
- Building Instructions
- Subsumption Architecture
- Online Resources
- 10. LegOS
- About legOS
- Development Tools
- Hello, legOS
- Function Reference
- New Brains for Hank
- Development Tips
- Online Resources
- 11. Make Your Own Sensors
- Mounting
- Passive Sensors
- Powered Sensors
- Touch Multiplexer
- Other Neat Ideas
- What About Actuators?
- Online Resources
- A. Finding Parts and Programming Environments
- B. A pbFORTH Downloader
- C. Future Directions
- Index
Heh (Score:1)
If you think you know what the hell is going on you're probably full of shit.
definately (Score:1)
carnage
Missing power jack in RIS 1.5 (Score:2)
(RCX is the programable brick)
How does Mindstorm compare? (Score:1)
Mindstorm seems like an interesting product but I'm wondering how it compares to more hands-on (dare I say, DYI) approaches like the one outlined in Mobile Robots (Jones et. al.)?
Anyone out there have some grounds for comparison?
--Paul
Re:Heh (Score:2)
D
----
This could be interesting (Score:2)
For the Casual User (Score:3)
I'd like to second the idea that this book is an introduction to Mindstorms. It does have a lot of useful references, and serves as an overview of What You Can Do with Your Mindstorms. There's not a lot of time spent on any one topic.
It would be nice to have another couple of chapters on more advanced topics ("Common Traps and How To Avoid Them", "Cool Hacks You'd Never Think Of", "a Beowulf Cluster of Mindstorms"). It's a good introduction, but don't expect a LEGO Camel.
--
in defense of legOS (i.e., a critique of Dave) (Score:2)
~luge (use it before you criticize, guys...)
$199.99 anywhere you care to buy it. (Score:1)
Re:How does Mindstorm compare? (Score:1)
My son is nearly turned 5
Any /. parents (or loco parents / aunts / uncles / cousins etc.) care to discuss good age ranges for introducing kids to Mindstorms ? It's very easy to hot-house kids into small-parts Lego when they simply don't have the motor skills to assemble the more fiddly parts.
Power meter? (Score:1)
Surprise (Score:1)
When I get the time I'll consider getting one. Maybe during winter break.
In all the sci-fi I've seen, I don't remember 'really cool toys' as part of the future. In retrospect, it's obvious. So here's my prediction, the future if chock full of cool toys.
(Wonders how much a battalion of Battle Droids would cost.)
Later
Erik Z
Other platforms .... (Score:1)
Is there a (younger 8-9ish) kid-friendly mindstorms development environment for the Mac? how about Linux? - the adult/hacker level stuff I can handle for Linux (hell I SELL an open-source microcontroller kit that does many of the same things, with my own OS/SDK/...), but the easy-start GUI thingy would still be fun toi have around.
Lego how about open-sourcing your GUI - let Linux people port it to their platform? - think of all the customers if Slashdot announced the Linux SDK ....
RoboTag (original page) (Score:2)
I haven't updated the web page in quite a while (other projects; you know how it is....). But take a look if you're interested.
--
Re:Other platforms .... (Score:2)
I believe you can run the robolab software in MacOS (robolab is the version of the mindstorm soft for schools) And if you can do C, legOS is the way to go...
Re:in defense of legOS (i.e., a critique of Dave) (Score:1)
This month's DDJ (Dr Dobbs Journal) also has a brief piece on the background to legOS
Re:Other platforms .... (Score:2)
MIT has a nice version of Logo that both has a GUI and is a complete, powerful programming language. I'm not sure if it runs on MS Windows, but definitely there's a Mac version. It's available to educators, but unfortunately not to anyone else.
--
K'nex anyone? (Score:2)
The one advantage that Legos have at this point is the MindStorms. K'nex only have a motor at this point which will "spin" pieces in a few different directions, but with a little creativity they are just as fascinating.
I hope someday to have a web page with my K'nex creations, but until then the only decent site I have found yet is at http://www.balmoralsoftware.com/knex/ knex.htm [balmoralsoftware.com]
Sorry, if this is too far off topic, but Legos seems to get a lot of press where K'nex have yet to be mentioned. Kinda like the Linux and Windows...
Imagination is the foundation of reality -Gallagher
Re:Other platforms .... (Score:2)
--
Invention System or Robolab? (Score:1)
Re:Surprise (Score:1)
Re:How does Mindstorm compare? (Score:1)
My son has been coding since he was 10, so he has no problems writing Mindstorms programs. I would let him play with the set more, if he didn't spread all the parts from one end of the house to the other... ;-)
K'nex doesn't do it for me (Score:1)
I tried it a few times, but I just can't get into it, I still prefer Lego. If I'm gonna build something K'nex like, I'll just break out the Technics.
Any ideas on how I can get more into K'nex?
George
Re:in defense of legOS (i.e., a critique of Dave) (Score:1)
~luge
How good are the Lego smindstorms? (Score:1)
They sound fun but I don't know if I'd ever get the time to play around with them(I work and go to school).
Thanks
Re:Other platforms .... (Score:2)
Using Emulation (VPC etal) and MindStorms Software on the Mac you will need get or to make a Powered Break-Out-Box.
Quick Hardware notes:
Yellow RCX 1.0:
The Original and the Best. Get a 1.0 box if you can and upgrade to 1.5 later. As said already 1.5 missing Wart-power.
Blue RCX, aka Scout:
OK, has a remote, missing an Output and has Internal LightSensor Block. Great with a MicroScout.
MicroScout (Droid Kit):
Best "Out of Box to Play" time of the whole line. 6 Hard Coded programs and no user program space. CD is a Building Guide and no IR tower.
Have fun
PS: RCX owners get Free Web Page on Lego Site. (for lego releated only).
O'Reilly (Score:1)
_joshua_
Re:Heh (Score:2)
As for software, well, with Linux you are pretty much stuck with PBForth [bmts.com] or legOS [www.noga.de]. Both of those are going to require a language (forth or C, respectively) but are going to be much more powerful than the standard software.
~luge
Oops, I meant a critique of Kurt(nm) (Score:1)
Re:Other platforms .... (Score:1)
--
Re:Power meter? (Score:1)
~luge
Also (Score:2)
~luge
Re:Invention System or Robolab? (Score:2)
~luge
Re:How does Mindstorm compare? (Score:1)
~luge
Re:How does Mindstorm compare? (Score:2)
~luge
Re:Heh (Score:2)
--
Autonomous Mindstorm Team Behavior? (Score:2)
The Kulturwehrmacht [onelist.com]
Controllers in Parallel (Score:1)
Re:Autonomous Mindstorm Team Behavior? (Score:2)
For 'team' robotic efforts, one resource to check out is Robocup [robocup.org], a world-wide robotic soccer competition.
I don't have any specific references here, but I believe there have been some published papers (as a result of this competition) regarding team coordination and strategies. A good starting search would be the various AI journals.
Good luck!
A brief primer on LEGO robots (Score:3)
Available from Pitsco/DACTA is the RoboLab, a LEGO robotics kit aimed more towards the Educational sector, primarily as a teaching tool for educators looking to teach scientific-minded youths the joys of programming and the wonderment that is robotry. It's available from PITSCO/Dacta [pitsco-legodacta.com]. I've ordered stuff from them online without having to prove if I'm an educator, but YMMV.
I've had the Unofficial Guide to LEGO Mindstorms for a month now, and my cats are starting to think I like my robots (Clumsy Pike and Hovis) better than them (Hydrox and Pork Chop, so they don't get jealous)(I think they've got FELUX running on my PC).
I hope that this is of some use to someone looking for the perfect gift for that geek on their Christmas list.
-The Cheese, who's next plan is to RULE THE WORLD!
PS; LEGO also sells a wireless IR remote for controlling the RCX.
PPS; Check out the online resources at LUGNET [lugnet.com].
Re:Power meter? (Score:1)
Re:How does Mindstorm compare? (Score:2)
I used Mobile Robots when building a robot for a competition in a 4th year engineering project. It was a two-person team, so I developed a lot of respect for how hard robots are to build.
I also own a Lego Mindstorms kit.
I would have to say that Mindstorms provides a much more solid base to build on. You can spend a lot less time getting electronics to work and a lot more fun doing the (IMHO) fun part - programming the behaviour, etc.
Of course, if your interests are more in the electronics (putting the board together, building your own sensors, etc.) then you might want to go the do-your-own route outlined in Mobile Robots.
plug it into the battery terminals (Score:1)
Re:Missing power jack in RIS 1.5 (Score:1)
hobby robots for Linux (besides Mindstorms)? (Score:1)
a fun idea.
I picked up a copy of "Robot Science and Technology" magazine and thumbed through it, and
unfortunately, just about everything seems to only have software support for Windows (other than the
hobbyist-developed stuff for Mindstorms mentioned here.)
However, I noticed one other thing - some articles about "Battlebots" and "Robot Wars" and such
implied to me that most of the robots in such contests aren't autonomous, but are actually
radio-controlled...
So...it seems that if one isn't "stuck" on the idea that the processor of an autonomous robot
"must" be an integral part of the robot, it seems that there's no reason you couldn't build a set of R/C hardware robotics...then write a nice, standard C, C++, Java, etc. etc. program that
runs from an old Linux box, and controls the robot from an R/C controller plugged into a serial or parallel port, or something of the sort. You'd have to put a transmitter on the robot to send sensor data back, but I imagine (in a purely academic if not outright naive way) that this isn't that big of a problem.
Plus, then you can take that old Beowulf cluster that's gathering dust in a corner of your apartment and build a supercomputer brain for your bot....
Which all leads, in a rambling, incoherent sort of way, to my question, which is - are there any good sites for "Hobby robotics with Linux" floating around on the net that anyone can recommend?
HANDIBOARD (Score:1)
Re:Autonomous Mindstorm Team Behavior? (Score:1)
Re:K'nex anyone? (Score:1)
One thing that would be great is a set of appropriate Lego Knex connector pieces, taking advantage of the strengths of each system. Lego is excellent for building solid-volume pieces of large mass. Knex is much better at building framed structures of low mass. It's easy to build a 6 foot Knex building, and a lot harder with Lego.
BTW, it is time to make plans for your Knex purchases. Every year, the day after Christmas, large Knex sets to on massive sale at Target. It is a great opportunity to stock up on big volumes of parts. The "hyperspace training tower" is a steal when it can be found for $49, as are the Ball Factory and the Roller Coaster.
Hint when building knex: sort out parts by color before commencing construction.
-dB
Re:omg your right (Score:1)
Maybe Energizer and Duracell offered them an incentive :)
Canadian Buyers... (Score:1)
Click me! [chapters.ca]
Re:K'nex anyone? (Score:2)
Greg
Better Lego kit: Kiss (Keep it Simple, Stupid) (Score:1)
http://www.kipr.org
Re:Other platforms .... (Score:2)
GCSE Information Systems, 1995. I had to play with some robotics, and we did this all with Lego running through Control Lab (I think - memory's a little hazy) under MacOS 7. Gave us lights, motors, rotation sensors, temperature sensors, light sensors and push switches. Programmed in something that I remember looking like a weird BASIC derivative. We made a greenhouse with a temperature regulation system - it was the original assignment, we just went thoroughly OTT on it! Others managed some really fun stuff like automated carwashes (well, simulated models... you get the idea!) , so it was a fairly powerful system. Not ideal, by any means - I remember being frustrated that I couldn't interrupt things - but it worked.
Would this be the same system, by any chance?
Greg
Control Mindstorms from Palm Pilot? (Score:1)
Is there any sort of development environment for the Palm Pilot to control Mindstorms? I suppose OmniRemote [pacificneotek.com] could be used just like the Mindstorms remote, but a complete development environment on the palm would be pretty cool.
Re:brief primer - RCX or Scout ? (Score:4)
I would recommend the RIS with the RCX for anyone who wants to get into the guts of the matter, as this will allow you to choose your programming environment, rather than be locked into the built-in environment of the Scout.
-Cheese, who really does have a real job.
Re:Invention System or Robolab? (Score:2)
The Cheese
Nitrozac Boot Squad
Re:K'nex anyone? (Score:1)
Re:Other platforms .... (Score:2)
The Cheese
Nitrozac Boot Squad
Better mindstorms book? (Score:1)
Re:This could be interesting (Score:2)
definitive answers to all questions lego (Score:2)
palm [lugnet.com] - palm development for Lego mindstorms
robotics [lugnet.com] - talk/problem solving about programming, building and designing robots in lego
a unique feature [lugnet.com] of LUGNET is the three way interaction between newsgroups using news (nntp), email (using smtp) and the web (using http). You can interact/subscribe through LUGNET by any of the above protocols and the discussions are simultaneously readable via news, web or email.
Re:How good are the Lego smindstorms? (Score:1)
Fortunately this was soon discovered and covered up. A new version of the series was released with the shortened title 'Mindstorm'. The only side-affect from this product appears to be a loss of brain cells, which is usually caused by the action of slamming one's head against the wall in frustration of getting one's bot to do things correctly.
Seriously though, Lego Mindstorm (Invention Sys) is great and definitely worth it. Especially the Add-On pack [Extreme Creatures]. I have had fun pitting my robot against my friend's in the basement. We have them programmed to attack and dismantle any robot they come across.
Re:Other platforms .... (Score:1)
Re:K'nex anyone? (Score:1)
replacing firmware is advantage, not disatvantage (Score:1)
I would say that the fact that pbForth and legOS replace the firmware is the main advantage - the firmware has some serious limitations (32 variables...)
I would say that the legOS is best environment, it is not very easy to set but it is not very hard either (on linux it is fairly easy).
the second best is pbForth. while it is true that the forth is not one of the most popular laguages, it is widely used in embedded systems, mainly because it is very efficient and I have heard lot of praise for this language. it takes a different mindset to use it but it definitely has good points...
I have both of these and I don't even consider nqc, mainly because it uses the LEGO firmware...
all above is IMO, of course, YMMV, I just wanted to point out that people might see it differently...
erik
Re:Better mindstorms book? (Score:1)
legOS: I think you should be able to get gcc up and running on mac (and then legOS works too).
erik