Code in Python, for the operation of a 4WD or 2WD robot, using OPENCV, in Control P(kp) and Control PID.
Visit Link: Using a standard USB webcam
Execute in Terminal:
sudo rmmod uvcvideo
sudo modprobe uvcvideo quirks=2
- Raspbery Pi 3B+ or Superior
- WebCAM
- CHASIS 4WD or 2WD
- TB6612fng or other Bridge H
- Motors 4 or 2
- REG 1117 +3.3V
- Battery
The algorithm was conducted similar to that of a follower line with sensors IR.
- cx is point Green = 466 (code line 24 - Line_Follower.py)
- middleX is point Red = 620 (code line 29 - Line_Follower.py)
error=cx-middleX (code line 35 - Line_Follower.py)
error = 466-620
error = -154
Execute PID TEST, replacing the values of cx and middleX PID TEST
LEFT MOTOR SPEED = 82.08
RIGTH MOTOR SPEED = 57.91

