This repository provides a compact SDK and examples for controlling Unitree actuators, including the GO-M8010-6, A1, and B1 motors. It includes both C++ and Python examples, as well as a GUI for higher-level control.
- Supported motors: GO-M8010-6, A1, B1
- GCC version:
- x86 platform: GCC >= 5.4.0
- ARM platform: GCC >= 7.5.0
Check your GCC version with:
gcc --version- Create a build directory and compile the code:
mkdir build
cd build
cmake ..
make- After a successful build, example executables will be available in the
build/folder.
The unitree_leg_gui folder contains a Python-based graphical user interface (GUI) for controlling a robotic leg. This GUI provides a higher-level interface compared to the C++ and Python examples, allowing for real-time control and feedback.
- Navigate to the
unitree_leg_guidirectory:
cd unitree_leg_gui- Run the
main.pyscript:
python3 main.py- The GUI window will open, providing controls for:
- Live Feedback: Displays joint angles, end-effector position, motor torques, and motor status (temperature, errors).
- Control Modes: Switch between inverse kinematics (IK) and direct angle control.
- Jump Motion: Execute predefined jump scripts with adjustable timing parameters.
- Live Feedback: Continuously updates joint angles, end-effector position, and motor torques in real-time.
- Control Modes:
- IK Mode: Specify the desired position of the end-effector (x, y, z) in millimeters. The GUI calculates the required joint angles using inverse kinematics.
- Angles Mode: Directly control the joint angles (θ1, θ2, θ3) in radians.
- Jump Motion: Execute scripted jump motions with adjustable parameters for crouch, hold, and explode phases.
gui_leg.py: The main entry point for the GUI. Handles user interactions, motor commands, and live feedback updates.kinematics.py: Provides forward and inverse kinematics calculations for the robotic leg.config.py: Centralized configuration for motor parameters, limits, and default values.jump_control.py: Implements the logic for scripted jump motions.
- Ensure proper permissions for accessing
/dev/ttyUSB0(e.g.,sudoorchmod). - Default serial baud rates and timeouts are critical for motor stability. Avoid modifying them unless necessary.
For detailed documentation, refer to the comments within the code files.