Project Tags

Admins

Members

Does this project pique your interest?

Introduction

The Azubot is a robot, which is movable through a chain drive. It has cameras mounted to a movable head, as well as visible light and infrared light LEDs. The brain of our project is a Raspberry Pi (version 3) with a specially designed shield mounted on top of it. This shield controls the motors, switches the LEDs, sends signals to the servos (controlling the head of the robot) and provides battery monitoring. Details for the shield can be found in the schematics section of our project.

All lights, motors and servos can be controlled wirelessly by a Playstation 4 controller connected via bluetooth. Alternatively other controllers can be used, as well as completely different input devices. With only a small effort, new devices can be connected to our project.

A parts list and all files needed to 3D print the robot yourself are attached in the files section.

The live images of the two Dart cameras are directly streamed onto an onboard webserver. You can reach the hosted website, by simply typing the IP-address of the Raspberry Pi into your browser. Beside the two images, also hardware statuses are displayed in an overlay. Informations shown are for example wether LEDs are switched on, what the battery state of the vehicle is, the framerate of the images arriving and how good the wifi signal is.

Another feature the Azubot has, is a mounted speaker in the back of the bot. It is connected to the Raspberry Pi and therefore offers the abbility to play all kinds of sounds whenever the user wants to. Because of copyright reasons, we have only put a self made demo sound into the repository. Still it is very simple to add your own sounds and map them to the controller. You just have to drag your own sounds into the direcotry /home/pi/sounds. Then create a method in Azubot.py, in which you copy everything from the demo sound method and just change the filename from demo.mp3 to for example example.mp3. Lastly just write your methods name into the button mapping of the controller (see ps4.py) and you are good to go.

Controls

In the released software version, we have used the following controls for the wireless controller:

Software Installation Instructions:

0.) Setup the Raspberry Pi with a fresh Raspbian image.

1.) Enable SSH (Not necessary but recommended):

In order to be able to run the following installation guide through network, activating SSH is necessary. Unfortunately SSH is not active by default anymore. If you want to skip this part and configure everything locally (with a monitor and a keyboard attached), continue with part 2.)

Connect your Raspberry Pi to a monitor and log in.

Then run the following command:

sudo raspi-config

A graphical user interface will open and you should select the following entries:

> Interfacing Options > P2 SSH > Yes

> Interfacing Options > P5 I2C > Yes > Finish

Then reboot the Raspberry Pi and it will be reachable via SSH through port 22.

1.a) WLAN (Not necessary but recommended):

To connect to the wifi edit the following file and put the following network config at the end of it. (Replace the credentials with yours.)

After reboot you should be connected to your wifi.

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

network={
ssid="MyNetworkName"
psk="MySecretPassword"
}

2.) Install pip

Pip is a tool for installing python packages. Since we will be installing a few, pip is the way to go.

Note: The python version used for this project is 3.6.

wget "https://bootstrap.pypa.io/get-pip.py"
sudo python3 get-pip.py

3.) Install PyPylon

PyPylon is the Python API for the Basler Pylon Software. It is used to interact with the mounted Dart cameras.

PyGame is required for handling the joystick inputs, such as Playstation 4 or X-Box Controllers.

sudo apt-get install python3-pygame

6.) Installing Dualshock4 driver

This driver is neccessary for the wireless Dualschock4 controller (Playstation 4). If you are are using an X-Box controller or other controller, you will have to find another driver. The only aspect to consider, is that the driver should map the controller device to /dev/input/js0. This is the location pygame is expecting joysticks or controllers.

sudo pip3 install ds4drv

7.) Installing pigpio

Pigpio controls the access to the hardware of the Raspberry Pi. It hosts a server on port 8887, which any client can connect to in order to drive the gpios, servos and others.

Flask is a python framework from which you can easily provide a webserver service. For our project we are using this webserver to display the images grabbed from the cameras and other informations provided by the sensors of the robot.

sudo pip install Flask

9.) Install SMBus

SMBus is a python package required for accessing information from the GY-88 multisensor (temperature, gyroscope, compass, pressure and accelerometer).

sudo apt-get install python3-smbus

10.) Using Azubot Software

First of all clone the Azubot git and place it on the raspberry pi directory /home/pi/Azubot.

Note: If the Azubot directory is not located in /home/pi/Azubot the following installation script and start/stop service won't work properly!

When completed, jump into the git and run the existing installtion script:

cd /home/pi/Azubot
sudo chmod +x install.sh
./install.sh

When the text "done" is displayed, your installation of the Azubot project is completed. After a reboot the cameras should be reachable over the webserver and the raspberry pi is ready to be paired with the controller.