The Azubot is a chain drive vehicle with two Basler Dart cameras attached to its movable head.
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.
In the released software version, we have used the following controls for the wireless controller:
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.
wget "https://github.com/basler/pypylon/releases/download/1.3.1/pypylon-1.3.1-cp27-cp27mu-linux_armv7l.whl"
sudo pip3 install pypylon-1.3.1-cp27-cp27mu-linux_armv7l.whl
4.) Installing OpenCV
OpenCV is required to convert a Numpy array to a jpeg.
First update the package list and the then die packages.
sudo apt-get update
sudo apt-get upgrade
Then install the following packages via apt-get:
sudo apt-get install build-essential cmake pkg-config
sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install libgtk2.0-dev libgtk-3-dev
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install python3-dev
sudo pip3 install numpy
Download and install opencv with the follwing commands (the build process may take up to an hour!):
wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.4.0.zip
unzip opencv.zip
cd opencv-3.4.0/
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_PYTHON_EXAMPLES=OFF \ -D BUILD_EXAMPLES=OFF ..
make -j4
sudo make install
sudo ldconfig
Now opencv should be up and running
5.) Installing PyGame
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.
sudo apt-get install pigpio –fix-missing
sudo apt-get install python3-pigpio
sudo systemctl start pigpiod
sudo systemctl enable pigpiod
8.) Install Flask
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!
sudo apt-get install git
cd /home/pi
git clone https://github.com/ace964/Azubot.git Azubot
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.
GERMANY\MMang | pushed b77416d6152efdc3a806ee590bac2272629bab5a | 2018-03-08 10:27:07 UTC | |
GERMANY\MMang | pushed 9439c1eb6fa337f684277155c327e9e9e51b2700 | 2018-03-07 13:46:51 UTC | |
ace964 | pushed 044c8b8c32c760c6411770291cc6a95b939460f7 | 2018-03-07 13:42:20 UTC | |
GERMANY\MMang | pushed d04bf3ec0030ef67aaccb89754613e6d8ab1a1c9 | 2018-03-07 11:42:02 UTC | |
GERMANY\MMang | pushed 468163e4fbfae07a4b2a68ce7593e9dedf6640ea | 2018-03-06 15:32:25 UTC | |
GERMANY\MMang | pushed bb0ca995919f201f138c3e89e4482466eb847a8d | 2018-03-06 14:24:59 UTC | |
ace964 | pushed 06b82fee6f0efd22993dc8223bd2aab3aad8cd4e | 2018-03-06 14:20:30 UTC |
Title | Description | Format |
---|---|---|
Schematic | Please open this file with eagle. | sch |
Board | Please open this file with eagle. | brd |
Project | Please open this file with eagle. | pro |
Schematic | ||
Board |
Title | Description | Format |
---|---|---|
Bill of Materials (german version) | A list of all used materials for the robot and their costs | xlsx |
Cover of the running gear | A model for 3D printing (please open with Sketchup) | skp |
Baseplate | A model for 3D printing (please open with Sketchup) | skp |
Mounting for the cameras | A model for 3D printing (please open with Sketchup) | skp |
Mounting for the speaker | A model for 3D printing (please open with Sketchup) | skp |
Layout robot | Please open with Sketchup | skp |
Construction of the appliance to swivel | Please open with Sketchup | skp |
Appliance to swivel (Part 1) | A model for 3D printing (please open with Sketchup) | skp |
Appliance to swivel (Part 2) | A model for 3D printing (please open with Sketchup) | skp |
Appliance to swivel (base) | A model for 3D printing (please open with Sketchup) | skp |
Want to comment this ...
Show more