In this tutorial, we will show you how to control your robot manipulator through web browser. We will use our handmade http web server, mjpeg streaming server, and robot server to achieve the goal. If you have not read the tutorial for HTTP Server, please read it first.
Let's first take a look what are we going to achieve after this tutorial.
robot-control-video-20220301.mp4
Hardware:
- Tinkerkit Braccio Robot
- Arduino UNO Rev3
- Raspberry Pi 3 Model B+
- Raspberry Pi Camera Module 2 (or other WebCam)
- USB 2.0 Cable Type A/B
Documents: The following codes can be downloaded from this repository Code folder.
File Name | Language | Function/Support | Purpose |
---|---|---|---|
http_server.c | C | HTTP Web Server | Web server, serving the web page to client web browser |
mjpeg_server.c | C | Streaming Server | Streaming server, serving MJPEG to client web browser |
picam.py | Python | Streaming Server | Communicate with Raspberry Pi Camera Module, output to mjpeg_server.c |
robot_server.py | Python | Robot Server | Listen from http_server.c. Output command to Arduino UNO through serial. Respond to http_server.c. |
utility.py | Python | Robot Server | Some function for robot_server.py |
arduino_braccio.ino | C | Robot Control | Listen from robot_server.py through serial. Output to Tinkerkit Braccio Robot. Respond motor status to robot_server.py. This programming is uploaded to Arduino |
index.html | HTML | Web Page | Web pages |
mystyle.css | CSS | Web Page | Web pages style |
robot.js | Javascript | Web Page | Web pages functions |
Please review the following system structure of our remote control robot design
We put the Code folder (provided in this repository) under Raspberry pi /home/pi/Desktop
. The command to run Http Server, Streaming Server, Robot Server are in the following image.