MonsterBorg - The ultimate Pi robot
Before starting
We recommend that you setup the software for running your MonsterBorg before you start assembly. These instructions assume you are running a recent copy of Raspbian, and they also assume you are using the pi
user (the default for Raspbian).
If you do not have your SD card setup yet you can find the downloads and instructions at http://www.raspberrypi.org/downloads. The instructions below will require the Raspberry Pi to be connected to the Internet in order to download the required software. We recommend you use a Raspberry Pi 3 with MonsterBorg, but other models of Raspberry Pi should work fine as long as you can mount them to the MonsterBorg chassis securely.
Setting up the Raspberry Pi
Since the Raspberry Pi is harder to access inside the MonsterBorg, we recommend you setup SSH so you can login to the Raspberry Pi using either the WiFi or a network cable. To setup SSH access:
- Enter the following command in a terminal:
sudo raspi-config
- Move down to option
5 Interfacing Options
and press ENTER - Move down to option
P2 SSH
and press ENTER - Make sure
Yes
is highlighted and press ENTER - Wait until the dialog says SSH is enabled, then press ENTER
- Move right until
Finish
is highlighted, then press ENTER
You may also want to set your router to give the Raspberry Pi a known IP address (so you can login to it later). Consult your router manual if you wish to do this.
Installing the ThunderBorg and examples
MonsterBorg uses a ThunderBorg to drive the motors. We will connect the board later, for now we simply need to install the software to control it.
MonsterBorg requires I2C to be enabled. If you have not done this before you can do this by:
- Enter the following command in a terminal:
sudo raspi-config
- Move down to option
5 Interfacing Options
and press ENTER - Move down to option
P5 I2C
and press ENTER - Make sure
Yes
is highlighted and press ENTER - When the dialog says I2C is enabled press ENTER
- Move right until
Finish
is highlighted, then press ENTER
To run through the automatic installer just use this one line in a terminal:
bash <(curl https://www.piborg.org/install-monsterborg.txt)
If you would prefer to manually run through the steps use the commands below:
mkdir ~/thunderborg cd ~/thunderborg wget http://www.piborg.org/downloads/thunderborg/examples.zip unzip examples.zip chmod +x install.sh ./install.sh mkdir ~/monsterborg cd ~/monsterborg wget http://www.piborg.org/downloads/monsterborg/examples.zip unzip examples.zip chmod +x install.sh ./install.sh
Once you have done this you will have two sets of examples:
- ThunderBorg examples in
~/thunderborg
The basic motor output and LED control examples will have links on the desktop - MonsterBorg examples in
~/monsterborg
This includes some standard examples such as remote control using a gamepad or joystick
Setting up joystick control (optional)
If you wish to use a gamepad / joystick to control MonsterBorg (such as a PS3 controller) you need the joystick software. You can get this by running the following command:
sudo apt-get -y install joystick
If you are using a PS3 controller it can be a little tricky to setup as you need to tell the controller to talk with the Raspberry Pi first. See either:
- How to connect a PS3 remote to the new Raspberry Pi Zero W if you are running a recent version of Raspbian with Pixel
- PlayStation 3 controller help sheet if you are using a terminal or older version of Raspbian
You can use the same instructions for a PS4 remote with the following changes:
- Skip using
sixpair
, it is not needed - When trying to pair the controller press the PS and Share buttons at the same time to put the controller into pairing mode
Setting up the Raspberry Pi camera (optional)
If you want to use the Raspberry Pi camera you will also need to install some additional software libraries. Before setting up the software, turn the Raspberry Pi off and connect the camera to the Raspberry Pi. There is a great guide from the Raspberry Pi Foundation on how to setup your Pi Camera.
After powering the Raspberry Pi you want to enable the camera functionality:
- Enter the following command in a terminal:
sudo raspi-config
- Move down to option
5 Interfacing Options
and press ENTER - Move down to option
P1 Camera
and press ENTER - Make right until
Yes
is highlighted and press ENTER - When the dialog says the camera is enabled press ENTER
- Move right until
Finish
is highlighted, then press ENTER - If asked if you would like to reboot, make sure
Yes
is highlighted, then press ENTER - Wait for the Raspberry Pi to restart
You can check the Raspberry Pi camera is attached and working by using the following command:raspistill -d
If the camera is working you should see the image from the camera on the monitor for a few seconds. If it is not working or incorrectly connected you will get error messages instead.
Next we want to install the Python library for talking to the camera:
sudo apt-get -y install python-picamera
Finally if we want to do image processing then we want the OpenCV libraries as well. This is needed for most examples which make use of the camera for doing their processing. The download is a bit larger and may take a while:
sudo apt-get -y install libopencv-dev python-opencv
Before assembling your MonsterBorg
Now we have all the code ready to go, there are a few things we want to do before assembly:
- If you plan to use either VNC or SSH to talk to the Raspberry Pi once assembled check they work before assembly
- If you are using a joystick to control MonsterBorg, attach it to the Raspberry Pi and use
jstest
to check it works
See our JoyBorg script page for instructions on how to check this - If you wish to use any other devices (such as a WiFi dongle), now is the best time to set them up and make sure they work
- Finally before assembling power the Raspberry Pi off and detach the camera
Once you have assembled your MonsterBorg head over to the examples page to see what MonsterBorg can do and get started with your own projects :)