Sbot Common Interface

From IridiaWiki
(Difference between revisions)
Jump to: navigation, search
(Write your own common interface controller)
(Common Interface QuickStart)
Line 26: Line 26:
#*make controller=describe_circle
#*make controller=describe_circle
#Copy binary to sbot and run it
#Copy binary to sbot and run it
#*tools/sbot_file_copy/describe_circle <sbotnumber>
#*./tools/sbot_file_copy/ describe_circle <sbot number>
#*ssh root@sbot<sbotnumber>
#*ssh root@sbot<sbotnumber>
#*cd /tmp
#*cd /tmp
Line 36: Line 36:
#*./twodee -e10003 --experiment-parameters controller=describe_circle
#*./twodee -e10003 --experiment-parameters controller=describe_circle
==Write your own common interface controller==
==Write your own common interface controller==

Revision as of 14:15, 28 March 2006


What is the common interface, and why should we use it?

Write Controller Once, instead of modifying for each platform.
  • Save time - no code rewrites. Maintain just one version of your code
  • When developing in simulation, you can do frequent reality checks on real robots.

Why common interface.png

Everyone shares a common build environment. We can stop reinventing the wheel.
  • All controllers stored in common repository. Can easily browse other people's code.
  • Share and jointly improve tools - eg. scripts for copying files to sbots
  • All extra libraries included in common interface - toolchain, sboteyelib etc.

Common Interface QuickStart

  1. Install subversion.
    • apt-get install subversion
  2. Checkout common interface from repository
    • svn checkout svn+ssh://<your iridia username>
  3. Compile one of the example controllers for the real robot
    • cd sbotci/real_sbot
    • ./build_scripts/ (build toolchain, sboteyelib etc)
    • make controller=describe_circle
  4. Copy binary to sbot and run it
    • ./tools/sbot_file_copy/ describe_circle <sbot number>
    • ssh root@sbot<sbotnumber>
    • cd /tmp
    • ./describe_circle
  5. Compile twodee and run an example controller
    • cd twodee
    • ./
    • ./configure
    • make
    • ./twodee -e10003 --experiment-parameters controller=describe_circle

Write your own common interface controller

You will need to familiarise yourself with the basics of source code control using svn. If you are already familiar with cvs this is a piece of cake, as svn commands are by in large a superset of cvs commands.

When you write your common interface controller, you basically have to implement three functions

  • Init()
  • ControlStep()
  • Stop()

Everything else is done for you.

Your code needs to live in the directory sbotci/controllers/<your_name>/<controllername>

If these directories do not exist you will have to create them and add them to svn with the svn add command.

The easiest way to get started is probable to copy one of the examples in the sbotci/controllers/generic directory into your own directory ( sbotci/controllers/<your_name>/ )/

  • cd sbotci/controllers/<your_name>
  • cp -r ../describe_circle ./my_test_controller
To compile your controller on the real sbot
  • cd sbotci/real_sbot
  • make controller=my_test_controller
To compile your controller in twodee
  • Anders - can you fill this in. Thx.

How to make your simulator compatible with the common interface

Anders - do you feel like having a crack at this one too.

Common Interface Class Diagram (sort of)

Common Interface Directory Structure

Personal tools