Welcome to DOGZILLA-Lite repository
8. Remote control
Remote control
1. Purpose of the experiment
This tutorial will guide you on how to control the lifting and lowering of the robot dog through finger distance, and realize key technical points such as height adjustment function.
2. Main source code path
First, end the big program, then open the browser and enter "ip (ip is the IP of the robot dog): 8888", enter the password "yahboom" and enter
the path to ~/DOGZILLA_Lite_class/6.AI Visual Interaction Course/08.Space control. Open the hp.ipynb program and run it , or enter it in the terminal
xxxxxxxxxxcd ~/DOGZILLA_Lite_class/6.AI Visual Interaction Course/08.Space controlpython3 hp.py
3. Experimental Phenomenon
After running the source code, you can adjust the height of the robot dog by controlling it with your fingers. Note: To control the height of the robot dog by gestures, bright light and a clean background are required to use this function.

4. Main source code analysis
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) frame = cv2.merge((b,g,r)) cv2.imshow('frame',frame) cv2.waitKey(1) if length!=0: if length>1000: length=1000 h=length/1000*40 dog.translation('z', 75+h) else: dog.translation('z',95) if button.press_b(): dog.reset() breakThe above source code is the indirection between the thumb and index finger to adjust the height of a mechanical dog.