Tutorial
Table Of Contents
- 1. Premise
- 2. Raspberry Pi System Installation and Developmen
- 3 Log In to The Raspberry Pi and Install The App
- 4 Assembly and Precautions
- 5 Controlling Robot via WEB App
- 6 Common Problems and Solutions(Q&A)
- 7 Set The Program to Start Automatically
- 8 Remote Operation of Raspberry Pi Via MobaXterm
- 9 How to Control WS2812 RGB LED
- 10 How to Control The Servo
- 11 How to Control DC Motor
- 12 Ultrasonic Module
- 13 Line Tracking
- 14 Make A Police Light or Breathing Light
- 15 Real-Time Video Transmission
- 16 Automatic Obstacle Avoidance
- 17 Why OpenCV Uses Multi-threading to Process Vide
- 18 OpenCV Learn to Use OpenCV
- 19 Using OpenCV to Realize Color Recognition and T
- 20 Machine Line Tracking Based on OpenCV
- 21 Create A WiFi Hotspot on The Raspberry Pi
- 22 Install GUI Dependent Item under Window
- 23 How to Use GUI
- 24 Control The WS2812 LED via GUI
- 25 Real-time Video Transmission Based on OpenCV
- 26 Use OpenCV to Process Video Frames on The PC
- 27 Enable UART
- 28 Control Your AWR with An Android Device
- Conclusion
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: