Lego Mindstorm Bot-Kit Port?

Dana S. Wheeler dwheeler at gte.net
Wed Apr 26 07:23:56 UTC 2000


Aaron J Reichow wrote:

> On Mon, 24 Apr 2000, Jay Casler wrote:
>
> [clipped]
>
> There are options available (with work) for Squeaking on an RCX:
> 1. Have Squeak generate NQC code (easier)
> 2. Use source from the NQC base to create primitives for comunicating
> with and compiling bytecodes for the RCX.
>

Documentation of the RCX bytecodes ( and a lot of other RCX info) can be
found at:
htt://graphics.stanford.EDU/~kekoa/rcx/index.html

What about having methods that generate properly formatted byte streams for
each opcode and then building successively more complex levels of functions
from these methods (or is this the same as #2 above)? Once you do this I
would think you could derive subclasses that would either control the RCS in
realtime or create and download programs.  No need for SPIRIT.OCX. Totally
portable.

There is also a lso C source for a utility to communicate with the RCX
through the IR tower (send.c). Its about 210 lines of code not counting
comments and empty lines. Can Squeak use procedures in an external library?
If so this would save a fair amount of work.

>
> [clipped]
>
> I also believe that NQC can communicate with the RCX in real time.

I looked over the html docs for NQC and I didn't see any mention of this.
Perhaps I wasn't looking in the right place.

>
>
> I think employing this could be a much more viable option.  Even better, a
> Squeak-NQC bridge could use the same API as the BotKit, perhaps a superset
> of it, so programs written on one system (BotKit on Dolphin/Win32) could
> be ported to another (RoboSqueak on Squeak/*).

Once you can get the basic opcodes I don't see why you couldn't recreate the
Dolphin API.  I've started writing methods but before I can go much farther
there are some basic questions that I need to answer.

    1. Exactly how is immediant execution of commands different from
downloading and executing programs from the RCX's viewpoint?
    2. In immediant mode many of the command opcodes return values signifying
success. In stored programs these return codes are ignored. In terms of class
hierarchy how should this be handled? Different classes for stored and
immediant mode or a single class with a state variable and some conditional
code?
    3. How should error recovery be handled? kick into debugger? log to file
and continue?
    4. At what level should the opcodes be checked for validity? In the
lowest methods or higher up? Actuall I would think at the lowest levels.
    5. Will Wiley Coyote ever catch the Roadrunner?

>
>
> Aaron

As I am sure you have already guessed, I am new to smalltalk and this OOP
thing. Any comments are welcomed.

Thanks

Dana


--
Dana S. Wheeler
dwheeler at gte.net

Maintain a humble awe in all things of God and a cynical skepticism in all
things of man.







More information about the Squeak-dev mailing list