Our Python Robots

Our worksheets and exercises are designed to work with two types of Raspberry Pi based kit robot. These are the Initio and Pi2Go robots produced by 4tronix. Which of these robot designs is more readily available varies (sometimes it is also easier to get these robots through other suppliers such as Amazon or CPC farnell than it is to get them through 4tronix itself). 4tronix have recently released the Pi2Go2 and we will be updating our resources to work with this in due course.

Setup Instructions for both robots can be found on the 4tronix website. Our resources are designed to work with Python 3, while the robots are set up with Python 2. Instructions for converting them to Python 3 are given below.

THE INITIO

BASIC INITIO ROBOT

The Initio Robot is more robust than the Pi2Go, but puts more strain on the batteries and we have found that the motors only really work with Eneloop Pro Rechargable Batteries. It has a more sophisticated set-up for the ultrasonic distance sensor that can move from side to side, but lacks the light sensors, LEDs and switch that give the Pi2Go a wider range of functionality.

To convert an Initio robot to work with Python 3 start up the Raspberry Pi. Open a Terminal and then type:

$ cd robohat

$ 2to3 -w *.py

We recommend adding the line export PYTHONPATH=$PYTHONPATH:~/robohat to the robot’s .bashrc file.

Part 4: Objects Part 4 of the worksheets which introduce objects and classes uses some additional support code. If you are going to use part four you should download bdi.zip and unzip it in the robohat folder.

THE PI2GO

The Pi2Go Robot is more temperamental than the Initio and a significant number of these robots do not function correctly when setup (typically one of the wheel motors switches on by itself and won’t subsequently respond to programming commands). However they are less power hungry than the Initio (they will work using non-rechargeable batteries but, again, the only rechargeable batteries we have found that can power them reliably are the Eneloop Pro) and have a wider range of functionality such as LEDs, light sensors and a switch.

To convert a Pi2Go robot to work with Python 3 start up the Raspberry Pi. Open a Terminal and then type:

$ cd pi2go

$ 2to3 -w *.py

We recommend adding the line export PYTHONPATH=$PYTHONPATH:~/pi2go to the robot’s .bashrc file.

Part 4: Objects Part 4 of the worksheets which introduce objects and classes uses some additional support code. If you are going to use part four you should download bdi.zip and unzip it in the pi2go folder.