Raspclaws
Raspclaws
Warning
Please pay attention to the following issues when purchasing or using the product:
There are small components included in this kit. Swallowing mistakenly or misoperation can
cause serious infection and be even fatal. When an accident occurs, please seek medical
assistance immediately.
Please place the product in a safe place where an under-6-year-old cannot touch, who should
not use or approach the product.
Juveniles should use the product with their parents.
Do not place the product or the components near any AC socket or other circuits to avoid
electric shock.
Do not use the product near any liquid or flame.
Do not use or store the product in an extreme environment such as in extremely low or high
temperature and heavy humidness.
Please remember to power off when the product is not in use.
Do not touch the moving or rotating part of the product.
The product may get heat at some part, which is just normal. But misoperation may cause
overheat.
Misoperation may cause damage to the product. Please take care.
Do not connect the positive and negative poles of the power inversely, or the devices in the
circuit may be damaged.
Please place and put the product gently. Do not smash or shock it.
About
Adeept is a technical service team of open source software and hardware. Dedicated to applying
the Internet and the latest industrial technology in open source area, we strive to provide the
best hardware support and software service for general makers and electronic enthusiasts
around the world. We aim to create infinite possibilities with sharing. No matter what field you
are in, we can lead you into the electronic world and bring your ideas into reality.
The code and manual of our product are open source. You can check on our website:
http://www.adeept.com/
If you have any problems, feel free to send an email for technical support and assistance:
[email protected]
On weekdays, we usually will reply within 24 hours. Also welcome to post in our official forum:
http://www.adeept.com/forum/
1
Copyright
This user manual and code can be used for learning, DIY, refitting, etc., except for commercial
purpose. The Adeept Company owns all rights of contents in the manual, including but not
limited to texts, images, data, etc. Any distribution or printing should be implemented with the
permission of the Company, or it will be deemed illegal.
2
contents
contents..........................................................................................................................1
1. Components List........................................................................................................ 2
1.1. Acrylic Plates.....................................................................................................2
1.2. Machinery Parts............................................................................................... 3
1.3. Electronic Parts.................................................................................................4
1.4. Tools..................................................................................................................5
1.5. Self-prepared Parts...........................................................................................5
Raspberry Pi ..................................................................................................... 5
2. Software & Hardware................................................................................................ 6
2.1. Software Installation........................................................................................ 6
3.2. Download Program.........................................................................................11
3.3. Set Up a Raspberry Pi..................................................................................... 12
3. Assembly.................................................................................................................. 19
3.1. Preparations before Assembly....................................................................... 19
1.Connect the Raspberry Pi Camera and the ribbon.............................................19
3.2. Servo debugging.............................................................................................22
3.3.Install and Remove Batteries...........................................................................25
3.3 install the arm..................................................................................................28
3.4 install the feet..................................................................................................31
3.5 install the Camera............................................................................................36
4.Install Python3.7 in the PC....................................................................................... 54
4.1.Install Python3.7..............................................................................................54
4.2Run the RaspClaws........................................................................................... 56
5.Afterword..................................................................................................................60
1
1. Components List
1.1. Acrylic Plates
The acrylic plates are fragile, so please be careful when assembling them in case of breaking.
The acrylic plate is covered with a layer of protective film. You need to remove it first.
Some holes in the acrylic may have residues, so you need to clean them before the use.
2
1.2. Machinery Parts
3
www.adeept.com
mpu—6050
3-Pin Wire X4
Car Light X4
4
www.adeept.com
1.4. Tools
Cross-head Screwdriver X1
Winding Pipe X1
Ribbon X1
18650 Battery X2
Raspberry Pi
5
www.adeept.com
6
www.adeept.com
Step2: Open the extracted “.img” Step1: Choose the right path
7
www.adeept.com
search on the Internet by yourself for how to display the filename extension (suffix) in your
own system.
For example, in Windows 7, you may go to My Computer ->Organization ->Folder and
Search->View, and uncheck the Hide extensions for known file types.
network={
ssid="WIFI"
psk="PASSWORD"
key_mgmt=WPA-PSK
priority=1
}
In the code above, replace WIFI with your own WiFi SSID name and PASSWORD with
your password for the WiFi network. Save the file and change the name of the file
wpa_supplicant.txt into wpa_supplicant.conf.
* Make sure MAC filtering has been turned off for the router.
* The WPA-PSK behind key_mgmt= is the common encryption method for most routers. If
the network connection fails, you may log in and check on the router management page.
* For more about the network connection for Raspberry Pi, please visit the related page
via this link:
https://www.raspberrypi.org/forums/viewtopic.php?t=203716
The two files newly created are as shown below:
8
www.adeept.com
9
www.adeept.com
10
www.adeept.com
NOTE: If you want to know the exact details of the program, you can skip this chapter.
NOTE: This setup.py program is needed to download and install a lot of applications and
libraries, and sometimes the server or internet may break down, which may lead to some
problems that the setup.py could not fix. Then you must set up a raspberry pi yourself, by
following the instructions of next chapter named Set Up a Raspberry Pi.
NOTE:
The installation process of the Raspberry Pi can take a long time, so we have prepared a
test version of the program which only needs to enable i2c and install adafruit_pca9685.
The test program runs as follows:
sudo pip3 install adafruit_pca9685
sudo pip3 install rpi_ws281x
sudo apt-get install python3-smbus
sudo pip3 install mpu6050-raspberrypi
Enable i2c (you can refer to the documentation on 3.3.5 to know how to enable i2c)
sudo python3 adeept_raspclaws/server/serverTest.py
(Test version doesn’t include OpenCV)
By default, the serverTest.py will not run when boot, so you need to add to autostart.
sudo python3 adeept_raspcalws/test_autorun.py
11
www.adeept.com
Update System
The system you downloaded may not be the latest version and it may cause
inconvenience in the subsequent operations. Here we first upgrade the system of the
Raspberry Pi. Type in the following command:
sudo apt-get update
The apt-get update command is to acquire the up-to-date software lists and update all the
software, to provide the latest software for next system upgrade.
sudo apt-get upgrade
The window will prompts "Do you want to continue", type in Y and press Enter.
12
www.adeept.com
It may take some time for the system upgrade. During this period, do not carry out any
operations with the Raspberry Pi until it's done.
In this process, you may continue reading the following contents to download the Python
3.7and OpenCV under the Windows system.
13
www.adeept.com
14
www.adeept.com
lsmod | grep i2c
If the following contents are shown, it indicates the module is enabled successfully.
Install I2C-Tools
Install I2C-Tools to check whether the external devices are connected successfully as well
as the address of the devices. Type in the command to install:
sudo apt-get install i2c-tools
Install the Python drive program for PCA9685:
sudo pip3 install adafruit-pca9685
To install the library from source, so that you can use the PCA9685 PWM servo/LED
controller with a Raspberry Pi.
Look for more information and example at its homepage:
https://github.com/adafruit/Adafruit_Python_PCA9685/
*Now you may wonder about the difference between apt-get install and pip install, here is
the answer:
pip3 is used to download and install packages directly from PyPI (Python Package Index),
hosted by Python Software Foundation. It is a specialized package manager that only
deals with python packages.
Note: There are two versions of Python in Raspberry Pi by default, for our Python
programs are written with Python 3.x(3.7), you need to use pip3 instead of pip, which is
used to install software in Python 2.x.
apt-get is used to download and install packages from Ubuntu repositories which are
hosted by Canonical.
OpenCV Installation
sudo apt-get install python3-smbus
OpenCV Installation
sudo apt-get install libopencv-dev
15
www.adeept.com
sudo pip3 install opencv-python
The libopencv-dev is a meta package. It has dependencies to many packages that do
contain the necessary libraries and header files that OpenCV require.
Python-OpenCV and OpenCV-Python are libraries of Python bindings designed to solve
computer vision problems.
More information:
https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_setup/py_intro/py_intro.html
Imutils contains a series of convenient functions which make basic image processing
functions such as translation, rotation, resizing, skeletonization, and displaying Matplotlib
images easier with OpenCV.
More information:
https://github.com/jrosebr1/imutils
libatlas-base-dev libjasper-dev libqtgui4 python3-pyqt5 libqt4-test are Python packages
for FPV functions and sending jpeg stream to PC.
Then you need to install zmq and pybase64 for FPV function:
sudo apt-get install libatlas-base-dev libjasper-dev libqtgui4 python3-pyqt5 libqt4-test
sudo pip3 install zmq pybase64
libatlas-base-dev libjasper-dev libqtgui4 python3-pyqt5 libqt4-test are Python packages
includes the static libraries and symbolic links needed for program development.
Zmp(ZeroMQ): Carries messages across inproc, IPC, TCP, TIPC, multicast.
Homepage: http://zeromq.org/
pybase64: It provides a fast base64 implementation for base64 encoding/decoding.
Homepage: https://github.com/mayeut/pybase64
Set AP-Hotspot
Configure the Raspberry Pi as the Wi-Fi hotspot mode to build up a direct communication
between the PC and the car.
If the RPi Car starts and there is no Wi-Fi to connect with, the RPi Car will set a
AP-Hotspod itself. You can connect it with your PC:
Search Wi-Fi SSID name: AdeeptCar
Password: 12345678
16
www.adeept.com
sudo apt-get install util-linux procps hostapd iproute2 iw haveged dnsmasq
17
www.adeept.com
18
www.adeept.com
3. Assembly
3.1. Preparations before Assembly
1.Connect the Raspberry Pi Camera and the ribbon.
19
www.adeept.com
20
www.adeept.com
Wires are connected to the input of Car Light (the end marked with a white strip pattern)
21
www.adeept.com
Adeept Motor
HAT x1
M2.5x14 Copper
Standoff x4
M2.5x10+6 Copper
Standoff x4
22
www.adeept.com
M2.5*4 screw
MPU-6050 x2
x1
M2.5x11
Copper
Standoff
x1
23
www.adeept.com
3. Connect the 18650 Battery Holder Set to the Adeept Motor HAT.
24
www.adeept.com
Roll one end of the ribbon to let through a battery and fix.
To remove the batteries, just pull the ribbon and take them out.
25
www.adeept.com
26
www.adeept.com
4. Before switching on, you need to insert the configured SD card into the Raspberry Pi. For
details, please refer to the third chapter of the document. Otherwise, the servo will not rotate
to the middle position after booting. If SD card is not inserted, the servo needs to be rotated to
the middle position manually.
Turn the switch here to “ON” (power on), the servo will automatically rotate to
the initial position. Wait a few seconds till the servo stop, and then turn the
switch to “OFF” (power off).
After debugging, remove the servo and battery holder, and take the 18650 batteries out of
the Holder Set. Do not rotate the rotation axis before the servo fixed to the rocker arm.
Otherwise, you need to re-debug the servo.
27
www.adeept.com
28
www.adeept.com
Assemble the following components Effect diagram after assembling
4 foot
M1.7*6*6 Rocker
Self-tapping arm x6
screw x2
M1.7*6*6
Self-tapping
Single Rocker screw
arm x1 x1
29
www.adeept.com
Assemble the following components
M1.4*6 Self-tapping
screws X4
Car light X 2
30
www.adeept.com
M2 Nut
X2
M2*8 Screw
X2
Servo x1
31
www.adeept.com
Assemble the following components
Single Rocker
M1.7*6*6 arm x1
Self-tapping screw
x1
32
www.adeept.com
Fix a debugged servo to the acrylic plate.
Assemble the following components
M2 Nut
X2
Servo x1
M2*8 Screw
X2
33
www.adeept.com
M3*10 Screw
X3
M3 Nut
X3
34
www.adeept.com
Fix Robot feet
Assemble the following components
M2.5*8
Screw
X1
35
www.adeept.com
M1.4*6
Self-tapping
screws X4
36
www.adeept.com
Assemble Pi Camera
Assemble the following components
M3 Nut
X4
M3*10 Screw
X4
37
www.adeept.com
M2 Nut
M2*8 Screw
X2
X2
Servo x1
38
www.adeept.com
M2 Nut
X1
M3 Nut
X2 M2*8 Screw
X1
M3*10 Screw
X2
39
www.adeept.com
Connect Assemble Pi Camera
Assemble the following components
M2.5*8
Screw
X1
40
www.adeept.com
Fix car light on Acrylic Plates
Assemble the following components
41
www.adeept.com
18650 Battery
Holder Set X1
M3 Nut
X2
42
www.adeept.com
M2.5*8 Screw
X4
43
www.adeept.com
M3*8 Screw
X8
44
www.adeept.com
M2.5*8 Screw
X6
45
www.adeept.com
When connecting the servo to the acrylic plate, connect the wiring to PWM interface, the driver
board will automatically check the position of the servo. Pay attention to the installation angle
when installing the servo.
46
www.adeept.com
The corresponding PWM numbers of the driver board to the servos.
7 6 4 5
9 8 2 3
The body
11 10 0 1
47
www.adeept.com
Servo
interfaces
48
www.adeept.com
M3*8 Screw
X8
Effect diagram after assembling
49
www.adeept.com
M3*15 Nylon
Standoff x4
50
www.adeept.com
M2.5*8
Screw
X1
51
www.adeept.com
M3*8 Screw
X2
M3 Nut
x2
52
www.adeept.com
53
www.adeept.com
Install OpenCV:
Press + R in Window and enter CMD in the textbox
Click OK
54
www.adeept.com
Type in:
pip3 install numpy
to Install numpy.
NOTE: If Python3.7 is the only version in your PC, you can use both pip and pip3 to install
software, but when you also have Python2.x installed, you must use pip3 to install it in
your Python3.7 library.
Download OpenCV_python.whl:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
And then you need to install zmq and pybase64 for FPV function (same reason in RPi):
pip3 install zmq pybase64
55
www.adeept.com
For initial running, you need to enter the IP address of the Raspberry Pi car IP Address,
then click Connect, and the program will connect to the Raspberry Pi.
56
www.adeept.com
After connection, the program will save the IP address. For the next use, if the IP address
of the Raspberry Pi has not changed, you may press Enter directly next time to connect.
After the connection is made successfully, the Video window shows up.
By default, the Robot finds the biggest yellow object in its view and follows it. When it gets
close enough, it would stop, and if it gets too close to the yellow object, it would go back.
Steady Function
After the Steady Function is turned on, the robot will maintain the balance of the body by
adjusting the height of each leg, but in this state, the robot cannot be able to move. This f
unction needs to continuously read data from the mpu6050 chip to ensure that the mpu6
050 and the Robot HAT remain connection.
57
www.adeept.com
If the camera on the robot detects an object moving or changing, the LEDs on the robot
will turn red. This feature is developed based on Adrian Rosebrock's OpenCV code on
pyimagesearch.com. You can also learn more about the OpenCV to gain more fun to play
with, such as syncing the captured image to the dropbox after detecting the motion of the
object. The example program we provide just makes the LEDs display red however. For
other functions, you can install the corresponding packages according to your needs, just
by changing the code in FPV.py.
Function 5 and Function 6 buttons are placeholders for other functions you want to add.
This robot is based on raspberry pi so there are a lot more functions you can play with, but
some other libraries are required.
We intend to simplify the installation steps as much as possible to lower the barriers for
more people. Hence, for example, voice recognition, which requires a large number of lib
raries to be installed, will not be provided in the standard program. If you are interested in
this, you can try to expand more. We will offer the installation and application methods of
other functions in the follow-up tutorials. Please subscribe our Youtube channel for more.
You can control the colors of the LEDs on the robot in real time by dragging these three
sliders. These three sliders correspond to the brightness of the three channels of RGB. In
theory, you can create 16,777,216 (256^ 3) kinds of colors through these three sliders.
Safe Shutdown
You may notice there's no such thing as a power button for the Raspberry Pi as for PC.
Most people would directly unplug the power cable for the Raspberry Pi, which may cause
damage to the Raspberry Pi and SD card, data loss, etc. To avoid such issues, you need a
safe shutdown for the Raspberry Pi.
If you just use the Raspberry Pi independently, you may shut it down with the following
command:
sudo shutdown –h now
58
www.adeept.com
When the green light stops blinking on the Raspberry Pi, you may unplug the power cable.
If you're applying the Raspberry Pi smart car, you may tab the Exit button in the app of this
product. When the green light stops blinking on the Raspberry Pi, switch to OFF for the
Power switch on Shield and you can shut down the Raspberry Pi then.
59
www.adeept.com
5.Afterword
Thanks for purchasing our product and reading the manual! If you spot any errors or have any
ideas or questions for the product and this guide, welcome to contact us! We will correct them if
any as quickly as possible.
After completing all projects in the guide, you should have some knowledge of the Raspberry Pi
and Robot, thus you can try to change the robot into other projects by adding more Adeept
modules or changing the code for extended functions.
For more information about Arduino, Raspberry Pi, Smart car robot, or robotics, etc., please
follow our website www.adeept.com. We will introduce more cost-effective, innovative and
intriguing products!
Thanks again for choose Adeept product and service!
60