Hiwonder SpiderPi User manual


First Part: Operation Guide .................................................................................. 3
1. Caution ................................................................................................. 3
1.1 Product List.................................................................................. 3
1.2 Charging ...................................................................................... 3
1.3 Operation..................................................................................... 4
1.4 Control and Connection ................................................................. 4
2. Mobile APP Control................................................................................. 4
2.1. Mobile APP Installation ..................................................................4
2.2. Mobile APP Connection..................................................................5
2.3. Mobile APP Operation.................................................................... 6
3. Computer Control................................................................................... 9
3.1 Control Software Download ........................................................... 9
3.2 Controlling Software Connection .................................................... 9
3.3 Controlling Software Operation .................................................... 10
Second Part: Advanced Tutorial ......................................................................... 14
6.1 Ultrasonic Obstacle Avoidance Code ............................................. 23
6.2 Modify the Detection Distance and Rotation Angle ......................... 23
7. Visual Patrol .................................................................................. 26
8. Advanced Tutorial .......................................................................... 27
8.1 Modify the Identification Color ..................................................... 27
8.1.1. Lab Colour Space ............................................................... 27
8.1.2. The Method of Turning RGB to Lab ...................................... 28
8.1.4. Modify the recognised colour............................................... 28
8.2 Raspberry Pi Hotspot Modification ................................................ 31
8.3 Common Linux Commands .......................................................... 34
9. Frequently Asked Question(FAQ) ........................................................... 36
9.1 Command Problem ..................................................................... 36
9.2 Control Section........................................................................... 36
9.3 Robot Section............................................................................. 38
9.4 Raspberry Pi Section ................................................................... 40
10. More Information........................................................................... 41
10.1 Contact us .............................................................................. 41

First Part: Operation Guide
1. Caution
1.1 Product List
After receiving the Raspberry Pi hex a pod robot, you need to check it
according to the Product list.
1.2 Charging
Since the battery cannot include power during transportation, please charge
the battery for more than 2 hours. The robot kit consists of a rechargeable
lithium battery and charger. Please pay attention to the following points
when charging:
1 ) The charging indicator will turn green when the battery charger i s
connecting to the battery without power supply.
2 ) When the charger i s connecting to the power supply. If the indicator is
red, it means that the changing hasn’t finished. If the indicator turns green,
it means the changing has finished.
Image 1 Battery Charging Schematic Diagram

3 ) When the battery voltage is lower than 9.6V, the robot will stop
working. Charge it on time; otherwise, it may damage due to over-
discharge.
1.3 Operation
1 ) Whatever the finished product or the unassembled parts package,
the SD memory card has a download system image.
2 ) When the robot is working, keep the robot away from your eyes to
avoid accidental injury.
3 ) When the robot is working, do not put your fingers in the working
range of the robot joints to prevent accidental injury.
4 ) Please put the robot on the smooth ground when you are using it,
otherwise, it may fall and damage some electronic components.
5 ) After the robot is on, please do not twist the joints, because it will
damage robot joint.
6 ) The servo of the robot includes various precise components. It needs
to be replaced after a long time or excessive use.
7 ) Long press the Raspberry Pi extension board KEY2 button can turn
off the Raspberry Pi when the bug occurs,but please avoid turning off the
power supply to shut down the Raspberry Pi
1.4 Control and Connection
1 ) The user of the finished product can use the mobile phone APP to
directly control after turning on the Raspberry Pi.
2 ) Mobile phone control support and Apple and Android systems, Apple
system version needs 9.0, or later, Android system version requires5.0 or
later, please ensure that GPS positioning is turned on before using.
3 ) The robot supports the PS2 handle control (the robot product does not
contain the PS2 handle, and it needs to purchase separately).
4 ) Support Wi-Fi connection, Wired, Wi-Fi LAN mode.
5 ) If the camera screen is not clear, please rotate it to adjust the focal
length.
2. Mobile APP Control
2.1. Mobile APP Installation
Scan the QR code below or find the "WonderPi" installation package file
(Android version only) in this folder. After downloading the apk file on
your mobile phone, click it to install(Android system version needs 5.0 or
later, iOS system version 9.0 or later).

Image 2-1 WonderPi Installation Package QR Code
2.2. Mobile APP Connection
Because the Raspberry Pi is able to launch Wi-F i hotspot in the default
mode. After our mobile phone connects to the Wi-F i created by the
Raspberry Pi. Following the instructions below to help the APP connect
to the Raspberry Pi robot.
1 ) Turn on the robot power switch. If the expansion board LED1 light
flashes in every two seconds, it means that the robot is working.
2 ) Open the phone's GPS location and Bluetooth and Wi-Fi, and select
first letters "HW" Wi-Fi to connect.

Image 2- 2 Phone Wi-FiInterface
3 ) Open the WonderPi software you just installed, click the search button
in the upper right corner. When the robot icon shown below appears, click
the robot icon to connect to the robot.
Image 2- 3 Mobile Phone APP Search Robot
2.3. Mobile APP Operation
Touch your phone screen; the App will appear the interface like the
image below. Phone App is able to control the robot do various
operations or control the robot camera (rotate camera can adjust focal
length).
Image 2-4 APP Control Interface

Table 1 APP Icon Function Table
Icon
function
icon
function
Click this button to
return to the device
selection interface
Click this button to
take a photo and
save it to your
phone.
Click this button,
and the options bar
will not appear on
the screen and
display full-screen
image, click it
again can call
option bar.
Click this can
show the action
group
Click this button to
show the game
switching optional
bar
Click this button
will show the
software version
and description.
Click this button
will open the photo
saving directory
Click this button to
refresh the device
list
Click this button
will stop the action
being performed
and run the
standing action.
Swipe left the area of the screen, and the camera will turn left; slide to the
right, the imaging head-turning; slid upward, taken to turn upward like the
first; slides down, the camera is rotated downward.

Image 2-5 Control System Interface
Image 2-6 Swi t ching the Gameplay

3. Computer Control
3.1 Control Software Download
Go to the "3. Basic Tutorial -> 3. Computer Control Software " folder in
the data and open the icon application directly (turn off the firewall
before opening the application ).
Image 3- 1 Terminal Application
3.2 Controlling Software Connection
1 ) Turn on the Raspberry Pi power switch
2 ) When Raspberry Pie is turning on, it will automatically launch a first
letter " HW" named hotspot. Turn on the computer (the desktop
computer needs to insert wireless network card) and connect this Wi-Fi.
Image 3- 2 Hotspot Name

3.3 Controlling Software Operation
1 ) Click the "Scan" button to scan the hotspot. after opening the 5.1
version terminal application
Image 3- 3 Interface Display
2 ) When the scan finishes, the camera's image will appear onthe
software interface.

Image 3- 4 interface display
3 ) Next, you can control the movement of the robot by clicking these
motion buttons on the left side of the interface.
4. VNC Installation
The Raspberry Pi is as a stand-alone minicomputer, so you can't connect
the Raspberry Pi tothe computer directly through the data cable. The
monitor can directly connect to the Raspberry Pi and display the system
interface. Users, who don’t have available monitor, can learn how to use
VNC to remotely control and operate the Raspberry Pi.
- VNC Control.
VNC is a graphical remote control software. With VNC, we can control
the Raspberry Pi directly on our computer through the Raspberry Pi
hotspot. Next, we will teach you how to use VNC.
1 ) Double-click the "VNC-Viewer-6.17.731-Windows" file in this
folder. In the pop-up dialogue box, select the installation language
as "English" and click the "OK" button.
Image 4-1 VNC Installation Language Selection
2 ) Click the "Next" button on the pop-up interface.

Image 4-2 VNC Installation Process
3 ) Click "Accept agreement" in the prompt box, and click "Next" to
enter the next step.
Image 4-3 VNC Installation Agreement
4 ) Click "Install" in the pop-up page.

Image 4- 4 VNC Installation Reminder
5 ) Wait for the installation. Click the “Finish” button to end this
installation. When all things are done, open VNC.
Figure 4- 5 VNC Installation Completion Prompt
6 ) After connecting the VNC successfully Double-
click to open

Second Part: Advanced Tutorial
1. How to do the gameplay
1 ) Use the charger to charge the battery (After charging finishes the
battery charger indicator will switch turn from the red to the green).
Insect battery to the Raspberry Pi, and turn on its power switch.
Th e LED1 and LED2 of the Raspberry Pi will keep on. After a while,
the LED1 will flash every 2 seconds, which means that the Raspberry Pi
is working.
2 ) The Raspberry Pi will launch a hotspot, which first letter name is HW
after opening the switch. The default IP address is 192.168.149.1.
Image 1-1 Raspberry Pi Wi-Fi
3 ) Enter the default IP address of the Raspberry Pi 192.168.149.1 in the
VNC Viewer: and press "Enter". Click "Continue" , If the software
warns that the connection is not safe.

Image l-2 IPInput Mode
4) Enter the password "raspberry"in the pop-up prompt box. (if it
requires to enter the account name, please "pi"), check the "Remember
password" box, and then click "OK". Raspberry Pi's desktop will display
on your computer’s monitor. After entering the Raspberry Pi interface, a
warning dialogue box will pop up(That’s a normal circumstance), click "
OK " to close it. (If black screen occurs,Please restart the Raspberry Pi .)
Image 1-3 Raspberry Pi Login Interface (If the first line cannot be entered, enter the
password to second-line directly.)

5 ) Click the LX terminal in the upper left corner (or click the
shortcut key Ctrl+Alt+T ), enter "cd hexapod/" and press "Enter" to
locate the directory where the game program is stored.
Image l-4 Terminal Open Position
Image 1-5 Locate the Game Directory
6 ) Enter l s -l ( This 'l' is the English letter 'L' )
Image 1-6 Enter the command to open the game program
7 ) Press Enter, you will find all the files in the directory displayed on the
LX terminal. The six .py files shown below are the gameplay file.
"Hexapond_balance.py" is the organism self-balance program,
"cv_color_tracking.py" is the body colour tracking program,
"cv_track_stream.py" is the cloud head colour tracking program,
"cv_color_stream.py" colour identification program, "cv_linefollow" is
line tracking program, and "sonar.py" is the ultrasonic obstacle
avoidance program

Image 1-7 Gameplay Directory File
8 ) When you want to run gameplay, you can enter "python3 program
name.py" and press "Enter" to run the gameplay. For example, to run the
colour identification gameplay program "cv_color_stream.py" , you can
enter the "python3cv_color_stream.py" command.
Image 1- 8 Enter Specified Gameplay Command
9 ) After pressing the "Enter", the camera image will pop up. If a red
object is placed in front of the robot, the robot will nod, but other colour
object put in front of robot, i t will shake its head.

Image 1- 9 Color Identi f ication Gameplay Running Interface
10 ) If you want to stop the game program, you can click the L X terminal
part and let its window be at the front, then press "Ctrl+C" on the
keyboard at the same time to stop running the game program.

2. Colour Identification
This gameplay mainly uses the camera to identify the object colour and let
the robot do specific action according to this, if the object is red, the robot
will nod, otherwise it will shake its head.
1 ) Start the VNC to remotely connect to the robot. Open the LX
terminal (shortcut Ctrl+Alt+T ), enter the command as shown below and
press "Enter" to locate the image recognition directory.
Image 2- 1 Image Recognition Program Location
2 ) Next, enter the command shown onthe image below. In the pop-up
window, we can see the real-time image. If there is a red object in front of
the camera, the object will be circled in the window, and the robot will
nod. Otherwise, it will shake its head.
Image 2-2 Colour Identi f ication Programs Running Command
Image 2-3 Colour Identi f ication Image
3 ) Press "Ctrl+C" on the keyboard at the same time to stop running the
game program.

3. Cloud Head Colour Tracking
In the last lesson, we have learned about the Raspberry Pi color recognition
function. In this lesson, we will learn how to let the robot recognise the
colour and let the camera follow the object of the target colour as well
1 ) Start the VNC to remotely connect to the robot. Open the LX
terminal (shortcut Ctrl+Alt+T ), enter the command as shown below and
press "Enter" to locate the image recognition directory.
Image 3-1 Image Recognition Program Location
2 ) Next, enter the command shown onthe image below. In the pop-up
window, we can see the real-time image. Ifthere is a blue object in the
camera's field of view, the robot head will follow the movement of the
object. The object cannot move too fast. Otherwise, it cannot catch it
Image 3-2 Cloud Head Colour Tracking Programs Running Command
Image 3-3 Cloud Head Bule Colour Object Tracking
3 ) Press "Ctrl+C" on the keyboard at the same time to stop running the
game program.
Table of contents
Other Hiwonder Robotics manuals