API

Programming your robot is done in Python, specifically version 3.9.6. You can learn more about Python from their docs, and our whirlwind tour.

Setup

The following two lines are required to complete initialisation of the kit:

from sbot import *

r = Robot()

Once this has been done, this Robot object can be used to control the robot’s functions.

The remainder of the tutorials pages will assume your Robot object is defined as r.

Running your code

Your code needs to be put in the zone-0 or zone-1 folder in a file called forklift.py or crane.py for the forklift and crane robots respectively.

If this file is missing or incorrectly named, your robot won’t do anything. No log file will be created.

Logs

A log file is saved in the output/ folder so you can see what your robot did, what it didn’t do, and any errors it raised. Each log file is in a folder based on its date and time, so you can look back at your previous runs.

Included Libraries

Python already comes with plenty of built-in libraries to use. We install some extra ones which may be of use:

If you would like an extra library installed, go and ask a volunteer to see if we can help.