Personal tools
You are here: Home sirblog SirBot: the (almost) Big Rewrite
About the SirBot Project
The SirBot Project is a framework on which you can easily build robots. Have a look at the SirBot Labs to see what can be done with it !
Here's the Tamabot DayCare, the bot that takes care of your tamagotchi !!!

And the SirBot Ranger is able to measure distances, and detect obstacles such as fruits...
« November 2008 »
Su Mo Tu We Th Fr Sa
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
 
Document Actions

SirBot: the (almost) Big Rewrite

by Sébastien Lelong posted at 2007-01-21 19:17 last modified 2007-01-21 19:17
Big changes in the SirBot Project...

The Jal migration has made me think about it differently. In a previous post, I was writing that "when I'm writing Jal code, it's quite similar to when I'm writing commands whithin the SirBot Project console". Actually, I was meaning I would like to interact with my bots the way I program them with Jal: with ease and simplicity.

Then I reconsidered what was this SirBot console (SBPC), and what it should do. The main underlying thing in the SBPC is a protocol file, an XML file which describes:
  • Protocol Units: the primitive actions understood by the bot
  • Orders: a set of protocol units or other orders
  • Tasks: a set of orders with loops and/or conditional statements

That is, this protocol file defines a kind of language to interact with the bot, and the SBPC uses this language definition. Now, why defining a new language ? It is necessary ? Of course not... This makes the project far more complex than required.

I've finally rewrite a big part of the SirBot Project architecture, removing all those XML files, in favor of pure python files. The language used to interact with the bot is just a python class, that's all. Using it just means to trigger a python CLI (such as ipython). Protocol units are equivalent to a method using a special decorator (more on this later), orders are just methods, tasks are just some python code. The important thing is, now, you can program your bot just like you'd do in python, all the power of the python language and its libraries... More on this later.

As a proof, here's the lines of code from the svn repository. The falling at the end corresponds to the merge of the branch I've used to rewrite the project. The picture show the code is ~ 2.5 shorter. Approx. 2500 lines disappeared, I just wonder where :). The code is just easy to use, and that's the matter. Following posts will explain how to write protocol files in python, and how to use them.

Alpha release is coming soon...


 loc.png




Category(s)
SirBot Project
Add comment

You can add a comment by filling out the form below. Plain text formatting.

(Required)
(Required)
(Required)
(Required)

(Required)

Powered by Plone Powered by Gentoo