User Manual
Table Of Contents
- 1. Premise
- 2. Raspberry Pi System Installation and Developmen
- 3 Log In to The Raspberry Pi and Install The App
- 4 Raspberry Pi Structure Assembly and Precautions
- 5 Controlling A 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 Calling the API to Control the Robot
- 12 Automatic Stabilization Function
- 13 Gait Generation Method of A Hexapod Robot
- 14 Make A Police Light or Breathing Light
- 15 Real-Time Video Transmission
- 16 Why OpenCV Uses Multi-threading to Process Vide
- 17 OpenCV Learn to Use OpenCV
- 18 Using OpenCV to Realize Color Recognition and T
- 19 Machine Line Tracking Based on OpenCV
- 20 Create A WiFi Hotspot on The Raspberry Pi
- 21 Install GUI Dependent Item under Window
- 22 How to Use GUI
- 23 Enable UART
- 24 Control Your Adeept_RaspClaws with An Android D
- Conclusion
74
●We control the robot to move forward, move backward, turn left, turn right, switch between fast and slow gait,
and maintain self-balance in move.py. When the webserver, py receives the forward command
"command_input", it will call the commandInput() function in move.py. When the commandInput() function
receives an instruction, it starts a thread, calls the corresponding action, and executes a fast gait by default,
such as forward moving, backward moving, left turn, and right turn:
def move_thread():
global step_set
stand_stu = 1
if not steadyMode:
'''
#The default value of steadyMode is equal to True when the initial value is 0, and then else is
not executed. When executing the self-balancing action, setting the initial value of steadyMode to 1
, which is if not steadyMode: equal to False, then it will execute else.
'''
if direction_command == 'forward' and turn_command == 'no':
if SmoothMode:
'''
#The default value of SmoothMode is equal to False when the initial value is 0, and it w
ill execute else; when switching to slow gait, setting the initial value to 1, you will get if Smoot
hMode: equal to True, then it will execute dove ().
'''
dove(step_set,35,0.001,DPI,'no') # slow gait of moving forward
step_set += 1
if step_set == 5:
step_set = 1
else:
move(step_set, 35, 'no') # fast gait of moving forward
time.sleep(0.1)
step_set += 1
if step_set == 5:
step_set = 1
elif direction_command == 'backward' and turn_command == 'no':
if SmoothMode:
dove(step_set,-35,0.001,DPI,'no') #slow gait of moving backward
step_set += 1
if step_set == 5:
step_set = 1
else:
move(step_set, -35, 'no') # fast gait of moving backward
time.sleep(0.1)
step_set += 1
if step_set == 5: