Copyright © 1998, 2001 by Ian Horswill, see comment within this file.
Running girl on Kluge requires running two different versions of Scheme. Kluge will be running its Scheme interpreter (cvmlisp), and you'll be talking to it via the radio network (klugeTelnet). However, since cvmlisp stinks, you'll be running the actual girl compiler under Scheme48 on tom-servo. The basic idea is that you'll load your code into Scheme48, then run compile-to-kluge, which will compile the girl code into cvmlisp code and transmit it over the radio network to Kluge, which will run it. In order to keep your sanity, we stronly suggest you use multiple emacs windows: one for Scheme48, one for klugeTelnet (cvmlisp), and one for your code.
Here's the procedure for setting things up:
You are now ready to hack girl code for Kluge. Note, however, that if you reset the DSP on the robot (or power cycle it), you will need to reload kluge-run-time.lisp.
To compile a girl program and send it to Kluge, just type:
(compile-to-kluge signals ...)
in the Scheme48 window. This will cause the compiler to compile a program consisting of signals ..., their inputs, their inputs' inputs, etc. It will not include signals that you have defined unless they are needed to compute the value of one of the signals listed in the compile-to-kluge call (there are a few exceptions to this, but you need not worry about them). The typical thing to do is to list the names of the motor controllers in the compile-to-kluge call. The name of the procedure generated by the compiler is "run" and it takes no arguments. So to run the program, just do (run) in the cvmlisp window.
If you simply want to see what the compiled code looks like, then use compile instead of compile-to-kluge.
Go to one of the emacs windows and grab the file /usr/local/lib/girl/examples/better-navigation.scm. Now go to the scheme48 window and type:
,load /usr/local/lib/girl/examples/better-navigation.scm
and then type:
(compile-to-kluge motor-controller)
You should see a bunch of symbol names print out in the cvmlisp window. Those are the names of the different procedures and variables being defined by the girl compiler. Now detether the robot and type (run).
The program is a relatively simple freespace follower, but it should give you an example of how to write simple girl code. You may want to try playing with some of the constants in the program (e.g. the time used in the wedged? signal) or add some more behaviors to it. Note that this program doesn't use the macros in behavior-utilities (it predates them), so you can't use a lot of the cool features of girl. A good learning project is to translate it to be a set of distinct behaviors, each represented as a group, as is done with the behavior utilities.