Tutorial

Table Of Contents
52
5 Controlling Robot via WEB App
The WEB app is developed for common users to control the robot in an easier way. It's convenient to use
WEB app; you may use it to wirelessly control the robot on any device with a web browser (Google Chrome was
used for testing).
Generally Raspberry Pi will auto run `webServer.py` when booting and establish a web server in the LAN.
You may then use any other computer, mobile or tablet in the same LAN to visit the web page and control the
robot.
How to tell whether the robot has run the `webServer.py` or not: If the WS2812-LED lights up with the
breathing effect, it means the robot has booted and runs the program automatically.
If the program is not run when the robot is booted, try to connect Raspberry Pi via SSH, manually run
`webServer.py` with code and check the errors. Refer to the Q&A below or email us for help (before manually
running `webServer.py`, you need to end the program possibly auto run in the back end to release resources.
sudo killall python3
sudo python3 [RobotName]/server/webServer.py
If the `webServer.py` is auto run successfully, open a web browser (here Google Chrome), type in the IP
address of the Raspberry Pi, with `:5000` added to the end, and go to the next step, as shown below:
192.168.3.157:5000
If no image is displayed, try manual running `webServer.py` as described in the step above.
If image is shown, you can control the robot to move now. You may check the description for keyboard
shortcuts `Instruction` at the bottom and control the robot based on its general functions with the keyboard.
`Video` window shows the image captured by the robot's camera in real time.
`Move Control` window is to control the basic movements of the robot.
`Arm Control` control the rotation of the robot Platform Servo.
·`UP`: control the Platform Servo to turn upward.
·`DOWN`: control the Platform Servo to turn down.
`CVFL Control` window is to control the visual line following function of the robot. Here only an overview
for the function is described; more details will be provided in the OpenCV section:
·`START`: Enable or disable the visual line following function.
·`COLOR`: Switch between white and black line following. By default the robot follows white lines; click
the button to switch to black line following.
·The line following function analyzes two pixels in parallel and utilizes the information detected; the
positions of these two pixels are `L1` and `L2`.
·`SP` is the threshold of the turning command based on the visual analysis results. A bigger `SP` value
means a big deviation; though a particularly small `SP` value may stop the robot from moving as it can't aim the
target and find the direction.
When the visual line following function is enabled, the video screen will automatically become
binarized results, making the visual analysis clearer.
`Hard Ware` window displays CPU temperature, CPU occupancy rate, and memory usage of the
Raspberry Pi.
`Actions`window control unique functions of the robot: