Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update modules import typos. Update python compatibility. Added requirements.txt #4

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ unitree_sdk2 python 接口

# 安装
## 依赖
- python>=3.8
- python>=3.8,<3.11
- cyclonedds==0.10.2
- numpy
- opencv-python
Expand All @@ -25,7 +25,7 @@ Could not locate cyclonedds. Try to set CYCLONEDDS_HOME or CMAKE_PREFIX_PATH
该错误提示找不到 cyclonedds 路径。首先编译安装cyclonedds:
```bash
cd ~
git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x
git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x
cd cyclonedds && mkdir build install && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install
cmake --build . --target install
Expand Down Expand Up @@ -102,7 +102,7 @@ python3 ./example/wireless_controller/wireless_controller.py enp2s0
终端将输出每一个按键的状态。对于遥控器按键的定义和数据结构可见: https://support.unitree.com/home/zh/developer/Get_remote_control_status

## 前置摄像头
使用opencv获取前置摄像头(确保在有图形界面的系统下运行, 按 ESC 退出程序):
使用opencv获取前置摄像头(确保在有图形界面的系统下运行, 按 ESC 退出程序):
```bash
python3 ./example/front_camera/camera_opencv.py enp2s0
```
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Python interface for unitree sdk2

# Installation
## Dependencies
- Python >= 3.8
- Python >= 3.8, < 3.11
- cyclonedds == 0.10.2
- numpy
- opencv-python
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
numpy
opencv-python
cyclonedds==0.10.2
32 changes: 18 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
from setuptools import setup, find_packages

setup(name='unitree_sdk2py',
version='1.0.0',
author='Unitree',
author_email='[email protected]',
license="BSD-3-Clause",
packages=find_packages(),
description='Unitree robot sdk version 2 for python',
python_requires='>=3.8',
install_requires=[
"cyclonedds==0.10.2",
"numpy",
"opencv-python",
],
)

def load_requirements(filename:str='requirements.txt') -> None:
with open(filename, 'r') as file:
return [line.strip() for line in file if line and not line.startswith("#")]

requirements = load_requirements()

setup(
name='unitree_sdk2py',
version='1.0.0',
author='Unitree',
author_email='[email protected]',
license="BSD-3-Clause",
packages=find_packages(),
description='Unitree robot sdk version 2 for python',
python_requires='>=3.8,<3.11',
install_requires=requirements
)
4 changes: 2 additions & 2 deletions unitree_sdk2py/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from . import idl, utils, core, rpc, go2

__all__ = [
"idl"
"utils"
"idl",
"utils",
"core",
"rpc",
"go2",
Expand Down