Introduction to LEGO MINDSTORMS Robotic Sumo - Navigational and Searching Mechanisms
(Page 8 of 9 )
When giving their robots navigational abilities, people will mount homemade electronic compasses, rotation sensors, and other amazing devices on their robots. Then they will load custom firmware into their RCX to complement these devices.
Unfortunately, just about any possible sensor or amazing contraption made for navigation you might place in your sumo-bot will not operate properly in robotic sumo. It simply will not work! This doesn’t have anything to do with the quality of the device or software. The reason is that when a sumo-bot is hit by another sumo-bot (which is going to happen in robotic sumo), it confuses the internal software, and the sumo-bot is immediately lost.
Can you use custom (homemade) distance sensors (a sensor that can see if something is in front of it) to help your sumo-bot search for its opponent? Some events do not allow custom sensors, so they are not implemented in the sumo-bots described in this book. As an alternative, the light sensor can be used to detect the proximity of another object, to some extent. There are also other methods you can use to help find the opposing robot, one of which you'll see in a later chapter.
Programming Tools The programming language included with the RIS—RCX Code—has been greatly improved since its first release. It is very capable of programming a sumo-bot efficiently and reliably. But the RCX Code language can be difficult to read with a large program, and people who are used to using textual programming languages can find it hard to work in this programming environment.
To program the sumo-bots described in this book, I have chosen the programming language NQC (for Not Quite C), which was created by Dave Baum. This is a very powerful textual language that is fairly easy to understand and learn. It is quite well known among the MINDSTORMS community, and many builders use this language to program all types of robots, including other LEGO microcomputers.
John Hansen is the maintainer of a great integrated development environment (IDE) known as Bricx Command Center (BricxCC), and this is currently the most popular way to program in NQC (see Figure 1-4). You can download the BricxCC program for free from http://bricxcc.sourceforge.net/.
Figure 1-4. Bricx Command Center’s main screen
NOTE As of this writing, Dave Baum has recently turned over the maintenance of NQC to John Hansen. John has transferred the NQC web site to a new address, http://bricxcc.sourceforge.net/nqc/, and all future versions of NQC, as well as documentation and information, will be appearing at this web address as soon as the switch has been completed.
A recent version of BricxCC, 3.3.7.6, now supports several different programming languages and all of the MINDSTORMS programmable bricks (and a few other LEGO programmable bricks as well). A window entitled “Searching for the brick” pops up (see Figure 1-5) before taking you to the main screen of BricxCC. In this window, you pick your microcomputer, programming language, and port for your IR tower. Thanks to John Hansen’s hard work and continuing efforts, programming with NQC and many other languages is now very user-friendly.
Figure 1-5. Searching for the Brick screen
As I mentioned, you are not limited to using only NQC or RCX Code to program your sumo-bots. If the rules for a particular event allow other programming languages, it might be a good idea to take advantage of this factor (yes, this is a factor in robotic sumo). What languages could you use? A great place to start is with those languages that BricxCC now supports. Let’s go through these custom-firmware programming languages to see what they’re about:
- brickOS: This language allows the user to program the RCX in the real-life programming language C. brickOS is renowned for its speedy execution of code.
- pbForth: This language is based on Forth, which is a well-known and veteran programming language. The name pbForth stands for Programmable Brick Forth. With its highly unique features and code structuring, this is a very powerful language with great potential.
- leJOS: This language is developed around Java. Besides the typical structure and heritage of Java, this language boasts numerous special features including navigational abilities, behavior controlling, and more.
NOTE In the past, brickOS, pbForth, and leJOS were difficult to set up and use. Now, using BricxCC version 3.3.7.6 and some downloadable all-in-one files that John Hansen has included on his web site, operating these languages is a breeze. The downloads, information, and John’s e-mail address for support can be found on the BricxCC web site: http://bricxcc.sourceforge.net/.
All three of these languages must be uploaded to the RCX in the form of custom firmware. Although none of them are used for the sumo-bots in this book, don’t let that stop you from using any of them. If you already know how to program in one or more of these languages, or would like to eventually learn any of them, feel free to use that language for the sumo-bots described in this book and for other sumo-bots you design. It will most likely give your sumo-bot a fighting edge!
This chapter is from Competitive MINDSTORMS: A Complete Guide to Robotic Sumo Using LEGO MINDSTORMS, by David Perdue (Apress, 2004, ISBN: 1590593758). Check it out at your favorite bookstore today. Buy this book now. |
Next: Robotic Sumo: A Game Within a Game >>
More Hardware Guides Articles
More By Apress Publishing