XGO2 has built-in motion libraries for controlling the movement and various features of the machine dog, including battery level, firmware version, and servo angle. The motion library enables users to control translation and pose movement, as well as single servo and single-leg movement. The education library facilitates camera, screen, key, microphone, and speaker operations, as well as commonly used AI functions such as gesture recognition, face detection, emotional recognition, and age and gender recognition. The detailed instructions for use of the library are as follows.
PythonLib included xgolib.py and xgoedu.py
1 Burn the latest official image
2 Run this command:
pip install --upgrade xgo-pythonlib
sudo pip install --upgrade xgo-pythonlib
Perform gesture recognition on the current camera and press the "c" key to exit.
from xgoedu import XGOEDU
XGO_edu = XGOEDU()
while True:
result=XGO_edu.gestureRecognition()
print(result)
if XGO_edu.xgoButton("c"):
break
xgolib library example
from xgolib import XGO
dog = XGO('xgomini')
dog.action(1)
- Update xgolib.py to 1.4.1
- Added xgo-rider instruction set and related motion functions
- Update xgolib.py to 1.3.9
- Add .gitignore
- Gesture image flip
- Methods: display_text_on_screen()
- Methods: posenetRecognition added.
- Methods: lcd_arc() and lcd_circle()
- Methods: Change the init in xgolib.py to add delay to resolve some movement irregularities.
- Methods: lcd_clear() was fixed.
- Methods: cap_color_mask added.
- CircleRecognition renamed BallRecognition and improved.
- Five Methods: SpeechRecognition SpeechSynthesis QRRecognition CircleRecognition ColorRecognitio added.
- xgoVideo and xgoVideoRecord method can be used.
- Fixed the issue with the xgoTakePhoto method that was causing abnormal RGB colors in the saved photos.