[Edu-sig] A potential LEGO Python robotics connection.

Morris, Steve smorris@cereva.com
Wed, 21 Mar 2001 09:04:39 -0500


There is a way to write LEGO robotics software in Python. The default
firmware in the computer brick is a VM which hass immediate commands and
downloadable software. On Windows LEGO provides a VXD (basically a software
library) that does all the heavy lifting of interacting with the RCX
computer. LEGO provides high quality documentation of how to use this VXD. A
simple Python wrapper around this VXD makes all of the capapabilities of the
machine available to Python running on the host. (The LEGO RCX has an
infrared link to the PC.)

This has already been implemented for many other Windows languages including
C++, Visual Basic, Smalltalk, and Tcl to name a few. Someone may have even
done it for Python already. These languages provide good examples of how to
do it.

The current language of choice for the RCX is called NQC (Not Quite C.) It
is quite usable for teaching robotics, certainly much better than the
graphical front end toy that LEGO delivers, but of course it is not Python
so off topic for this list. NQC is basically a compiler that compiles to the
native VM of the RCX. The reason it is Not Quite C is that the VM isn't
powerful enough to support C. NQC is a C like language that efficiently
lives within the restrictions of the RXC VM.

Systems like LegOS and pbForth go one step further. They are firmware that
replace the RCX VM completely. LegOS is C based and could theoretically
support Pippy if it was small enough.

The current state of the world of low end robotics is that platforms like
the LEGO RCX are really too small and slow to do much and real platforms
like PC/104 are too expensive and lack the basic infrastructure to glue high
level languages to sensors and actuators. Moore's law is solving the PC/104
price problem and efforts like Jonathan's should solve the second. In five
years robotics will be widely available for all levels of teaching. Today it
is a path for the early adopter pioneers willing to do a lot of distracting
(from the teaching point of view) nitty gritty work.