Skip to main content

Easy AI Robot Control Library for Go2 and Computer Vision

Project description

EZAI - 简单易用的AI机器人控制库

PyPI version Python versions License: MIT

EZAI是一个专为Go2机器狗和AI应用设计的简化Python接口库,让机器人控制和计算机视觉变得简单易用。

🚀 特性

  • 简单易用: 专为初学者设计的API接口
  • 模块化设计: 支持按需导入,减少依赖
  • Go2机器狗控制: 完整的运动控制和视频流支持
  • 计算机视觉: 集成OpenCV,支持图像处理和显示
  • AI工作流: 支持ONNX和RKNN模型推理
  • 教育友好: 适合STEM教育和编程学习

📦 安装

基础安装

pip install ezai-go2

完整安装(包含所有可选依赖)

pip install ezai-go2[all]

仅安装ONNX支持

pip install ezai-go2[onnx]

仅安装RKNN支持

pip install ezai-go2[rknn]

🔧 Go2 SDK安装

要使用Go2机器狗控制功能,需要额外安装unitree-sdk2py:

# 从官方源码安装
git clone https://github.com/unitreerobotics/unitree_sdk2_python.git
cd unitree_sdk2_python
pip install -e .

📖 快速开始

Go2机器狗控制

from ezai import Go2

# 创建Go2控制器
dog = Go2()

# 连接机器狗
if dog.connect():
    # 前进
    dog.move(0.5, 0, 0)  # vx=0.5, vy=0, vyaw=0
    time.sleep(2)
    
    # 停止
    dog.move(0, 0, 0)
    
    # 断开连接
    dog.disconnect()

计算机视觉

from ezai import Camera, OpenCVUI

# 创建摄像头
camera = Camera()
ui = OpenCVUI()

# 捕获图像
image = camera.capture()
if image is not None:
    # 显示图像
    ui.show_image("Camera", image)
    ui.waitKey(0)

AI推理(ONNX)

from ezai import ONNXWorkflow

# 创建ONNX工作流
workflow = ONNXWorkflow("model.onnx")

# 加载图像
image = cv2.imread("test.jpg")

# 运行推理
result = workflow.run(image)
print(f"推理结果: {result}")

📚 模块说明

Go2模块

  • Go2: Go2机器狗主控制类
  • 支持运动控制、状态查询、视频流等
  • 自动网络接口检测和IP配置

Camera模块

  • Camera: 摄像头控制类
  • 支持USB摄像头和网络摄像头
  • 简化的图像捕获接口

UI模块

  • OpenCVUI: OpenCV显示界面类
  • 简化的图像显示和交互接口
  • 支持窗口管理和事件处理

AI工作流模块

  • ONNXWorkflow: ONNX模型推理
  • RKNNWorkflow: RKNN模型推理
  • 统一的推理接口设计

🛠️ 开发

安装开发依赖

pip install ezai-go2[dev]

运行测试

pytest tests/

代码格式化

black ezai/

📋 依赖要求

  • Python >= 3.7
  • OpenCV >= 4.5.0
  • NumPy <= 1.24.3
  • Pillow >= 8.0.0
  • netifaces >= 0.10.0

可选依赖:

  • unitree-sdk2py (Go2控制)
  • onnx + onnxruntime (ONNX推理)
  • rknn-toolkit2 (RKNN推理)

🤝 贡献

欢迎提交Issue和Pull Request!

📄 许可证

本项目采用MIT许可证 - 详见 LICENSE 文件

📞 联系方式

🙏 致谢

感谢Unitree机器人提供的Go2 SDK支持!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezai_go2-1.0.9.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ezai_go2-1.0.9-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file ezai_go2-1.0.9.tar.gz.

File metadata

  • Download URL: ezai_go2-1.0.9.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.6

File hashes

Hashes for ezai_go2-1.0.9.tar.gz
Algorithm Hash digest
SHA256 f9c241ec64be350e4f542a88a31e1133d7c72ca10135eea437b26ef26b9d8bc8
MD5 06dcada550ff2fc053f21d9709019e4b
BLAKE2b-256 ef4a3518e185c95b3209c80984d89cefabe8c49156ec0dda67c0547123503276

See more details on using hashes here.

File details

Details for the file ezai_go2-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: ezai_go2-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.6

File hashes

Hashes for ezai_go2-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 da1f4fc6691ecc69c232c735cf280259ac468067059d98781bd37611bc8fad91
MD5 d5b60509338af7bc0c064363f2323252
BLAKE2b-256 f8482897b0f1c6910595f8604eb923ae21512806e4a8c668bd990255d922bd86

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page