Welcome to Rider Pi Robot repository
5. Finger control
Finger control
1. Experimental purpose
Drive the car for remote control
2. Experimental path source code
Enter the car system, end the car program, enter "ip (ip is the car's ip): 8888" in the browser, enter the password "yahboom"
Then log in
Enter the path of /home/pi/Rider-pi_class/6.AI Visual Interaction Course/5. Space control/ and run hp.ipynb.
Or directly enter
/home/pi/Rider-pi_class/6.AI Visual Interaction Course/5. Space control/python3 hp.py3. Experimental phenomenon
Control the height of the robot through gestures. This function requires bright light and a clean background. Otherwise, it is difficult to recognize the result.
The car cannot be in a stopped state (i.e. not in a standing balance state), otherwise it cannot move.

4. Analysis of main source code parameters
xcap = cv2.VideoCapture(0) cap.set(3, 320) cap.set(4, 240)length=0 while True: success, img = cap.read() img, lmList ,length= htm.handDetector(img) b,g,r = cv2.split(img) img = cv2.merge((r,g,b)) imgok = Image.fromarray(img) display.ShowImage(imgok) r,g,b = cv2.split(img) image1 = cv2.merge((b,g,r)) cv2.imshow("image1",image1) if length!=0: if length>1000: length=1000 h=length/1000*40 car.translation('z', 75+h) else: car.translation('z',95) if button.press_b() : car.reset() break if cv2.waitKey(5) & 0xFF == 27: car.reset() break cap.release()From the source code analysis, we can see that the car will control the gesture according to the width of the camera. The larger the width, the higher the car will stand, and the smaller the width, the car will squat. The recognition results will be displayed on the screen of the car and the screen of the computer.