Gene splicing
What I’m working on at the moment is a simple system to describe robot behaviour. Similar things have been done elsewhere, and better, but it’s keeping me off the streets.
As a testbed for my experiments I’ve bought a couple of kits from Microbric in SA (my rating for them is AAA, BTW).
The "Viper" consists of a number of electronic and mechanical "blocks" and other parts, which are bolted together to form various wheeled-type machines.
The embedded Basic Atom controller allows you to program up about 10K lines of MBasic to control the various motors, I/R receivers, LED’s, switches and servos you select for you particular robot de jour.
Anyway, the departure from this stock stuff for me is to write a compiler of a descriptive language reminiscent of "Warplan" from the 1970s (!) and compile that into MBasic. Warplan is one of a family of planning languages, except it was based on primitive operations like predicate logic and unification, rather than other planners that are based on LISP/Scheme and explicit manipulation of standard variables and state.
The idea behind a planner is to describe the goals you want the behaviour or activity of your robot to achieve, rather than exactly how to perform a given action.
E.g. a planner is told "I want that lightswitch on". Instead of a sequence of operations that will turn the lightswitch on. It’s then up to the planner to find a sequence of operations that will result in the goal being acheived (or in singalling no such sequence can be found).
The operations and their properties are, of course, supplied by the programmer in a descriptive form. E.g. you might say something like "regard it as impossible to remove the bottom block from a pile" or "the lightswitch is 3 feet off the floor" or "you can only reach 2 feet off the floor" or "there is a pushable block 2 feet high in the room where the lightswitch is". You get the idea…
The actual syntax of the language (in my case) is a bit like Prolog.
Various heuristics can be used to find the sequence of operations (i.e. the "plan"). E.g. depth-first search, incrementally deeping DFS, or various other methods.
Beside brevity the other great advantage of DESCRIPTIONS rather than PRESCRIPTIONS for robot programming is you can splice them together very easily (and hence the subject line).
In my first experiment, to be documented a bit better later (someone is breathing down my neck as I write this :-}, I’ve taken 2 descriptions of different simple robots that can be made with the "Viper" kit — a more-or-less standard bumpbot and an IR-controlled 2-wheeled bot — and spliced them together by simply concatenating the 2 descriptions and passing the whole thing through my compiler to generate the MBasic output.
Uploading to the Viper via its RS232 cable shows the splice worked out. The robot waits for a pushbutton before starting; it then wanders around, backing away from and around obsticales; when an IR signal for forward/back/left/right comes in it briefly leaves its wandering state and performs the relevant command.
This all sounds rather trivial, but it isn’t. E.g. the behaviour behind the button originally belonged only to the bump-bot. It needed to know when to start moving (and stop moving). Obviously, the remote-control robot only moved when it received an IR command, so it needed no "start" button.
So here’s one trick — when splicing the 2 descriptions together the system COULD have left the behvaiour relevant to the button ONLY connected to the bump-bot "persona". But it chose to move that out to surround the entire slice-bot behaviour.
This didn’t happen by magic — one of the heuristics (and a tricky one to get right) involved in the splicing is to maximize robot activity. And this required the button activity to surround the whole splice-bot program rather than remain embedded in just part of it where is might continually keep turning the bump-bot persona on and off.
(As an interesting aside, another robot splice I created was a bit heavy on the juice. The "viper" is powered by 6 AAA cells and mine were a bit weak, despite being purchased from the supermarket only a few hrs before. Anyway, as a result if the wheels on the bot got stuck — i.e. the bot hit an obstacle and couldn’t back away from it– the drain on the batteries caused the controller to brown-out and the bot APPEAR to have received an IR control to stop. So another heuristic I’ll have to be building into my compiler is "minimise power consuption"
.
OK. Maybe I haven’t explained all this very well…
I’ll post some pix and videos tomorrow…
Awesome stuff!
I had thought about something along similar lines but could never really come up with a elegant way to decompose tasks enough to allow a robot to actually carry out anything. I am looking forward to seeing what you come up with
I have enabled TinyMCE (a rich editor) so editing posts should be easier in future. Let me know if you have any issues with video or picture uploads and i’ll sort it out asap.
Also I have started a FAQ section that you will be able to edit but I am going to try to set up a separate page on the site with supplier info. I need a good supply of gear motors!
Thanks ash. I noticed the FAQ section and all the new features.

Things are starting to arrive so I’m also keeping busing unpacking stuff — and making sure I’ve been sent the *right* stuff — so I haven’t been online as much as I might for the past few days. Maybe that’s a GOOD thing…
I’ll probably go back over some of my blog & articles to include the bolding, underline and titles, etc.
I have a few small videos of my Viper experiemnts, but I was thinking of putting them on my Youtube account and just linking to them to say some space.
I was also wondering — it probably costs you something to keep this site going; would it be an idea to have a "donate" button so I can shuffle you off some money? Or would the accounting be too much of a hassle?
As for motors — I’ve been looking around and have a list. I’ll post up something over the next couple of days.
In the meantime you could give people like http://oceancontrols.com.au (Vic) or http://www.picblokcorporation.com (Qld) a browse. Unfortunately, neiher of these is too responsive to random e-mail — a habit that tends to give me the willies — but the parts lists at least at oceancontrols should be pretty indicative of what’s out there.
(I seem to remember piclok is having a www facelift).
You might also look at http://www.pololu.com (US based). Another one of my AAA suppliers. I seem to remember that have motors &/or servos from "large" down to "pico". And they give a 10% price break at 10 units.
I’d be interested also in getting together a bulk order with 1 or 2 people (e.g. I’d like about 10 motors and servos of different sizes).
Hmm weird, it won’t let me reply to the comment you left for some reason so I’ll just reply to this one…
Thanks for the links. Oceancontrols seem to be a good supply for gear head motors and servos at a reasonable price. I am going to check some hobby RC stores on the weekend to see what they charge. The last servos I bought were actually from Jaycar and really overpriced for what they were. Polulu looks cool, I have been there before but only to check out the laser cut plastic service they provide. One day I will have to get something cut
Feel free to embed or post vids in any format you want. The videos on the first big post I put up were YouTube ones embedded using a Drupal plugin I enabled on the site but I can’t help but think that it was more effort than it was worth. I guess do whatever is easiest for the time being and we can move em later.
The site itself is being run from the same dreamhost account as my other sites and that account is so ridiculously cheap that no money is needed, but thanks for the offer!
I am still totally up for a meeting of some sort – not sure what that would entail yet – just buy me a beer then hehe
Mostly I just realised that I had to do something about helping to turn Optimus prime from a cartoon character into reality! (Yes I watched the Transformers movie again the other day
This is pretty heady stuff.
I have not programmed properly since my appleII days.
But I tell you I could do more in 3lines of basic than I can do with a page of C.
I am not familiar with these languages you speak of, but I am interested. I am sick of all the arduous details involved with manipulating modern systems.
But then again I created a speaking avatar using VB6 in just a few lines of code too!!!! … and then I couldnt POKE to val………….frustration.