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
77
12 Automatic Stabilization Function
● Based on the automatic stabilization function of the robot realized by MPU6050 , after starting this
function, you can place the robot on a panel, and then tilt the panel. The robot will keep the body balanced by
changing the height of the corresponding leg. At the same time, when this function is started, the robot cannot
perform other movements. Click this button again to close the automatic stabilization function.
●You can refer to **5 Using the WEB application to control the robot** to start the automatic stabilization
function.
●The robot maintains its self-balance mainly by adjusting the movement of the legs in the Y direction.
def steady_X(): #Initializing the servo in the X axis direction
if leftSide_direction:
pwm.set_pwm(0,0,pwm0+steady_X_set)
pwm.set_pwm(2,0,pwm2)
pwm.set_pwm(4,0,pwm4-steady_X_set)
else:
pwm.set_pwm(0,0,pwm0+steady_X_set)
pwm.set_pwm(2,0,pwm2)
pwm.set_pwm(4,0,pwm4-steady_X_set)
if rightSide_direction:
pwm.set_pwm(10,0,pwm10+steady_X_set)
pwm.set_pwm(8,0,pwm8)
pwm.set_pwm(6,0,pwm6-steady_X_set)
else:
pwm.set_pwm(10,0,pwm10-steady_X_set)
pwm.set_pwm(8,0,pwm8)
pwm.set_pwm(6,0,pwm6+steady_X_set)
def steady(): #Adjust the Y direction of the servo to maintain the self-balance
global X_fix_output, Y_fix_output
if mpu6050_connection:
'''''
Determine whether the MPU6050 is connected '''
accelerometer_data = sensor.get_accel_data()
'''''
Read the data of MPU6050
'''