From dc85ee35a5272f83915ac08027bbe5adf99af42e Mon Sep 17 00:00:00 2001 From: Oya-Tomo <82521012+Oya-Tomo@users.noreply.github.com> Date: Sat, 13 Dec 2025 00:00:59 +0900 Subject: [PATCH 1/2] add project table to pyproject.toml --- pyproject.toml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 07de284a..665340a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,25 @@ [build-system] requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" + +[project] +name = "unitree_sdk2py" +version = "1.0.1" +description = "Unitree robot sdk version 2 for python" +readme = "README.md" +requires-python = ">=3.8" +license = "BSD-3-Clause" +authors = [ + { name = "UnitreeRobotics", email = "unitree@unitree.com" } +] +dependencies = [ + "cyclonedds==0.10.2", + "numpy", + "opencv-python", +] + +[project.urls] +"Source Code" = "https://github.com/unitreerobotics/unitree_sdk2_python" + +[tool.setuptools.packages.find] +include = ["unitree_sdk2py", "unitree_sdk2py.*"] From c158c8df2dab8f2dde0cb36a0f70927d6c71d5a4 Mon Sep 17 00:00:00 2001 From: Oya-Tomo <82521012+Oya-Tomo@users.noreply.github.com> Date: Thu, 9 Jul 2026 09:51:27 +0900 Subject: [PATCH 2/2] update: add uv setup --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/README.md b/README.md index fa4df004..b7bbadb1 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,58 @@ git clone https://github.com/unitreerobotics/unitree_sdk2_python.git cd unitree_sdk2_python pip3 install -e . ``` + +### Installing from source with uv +If you use [uv](https://docs.astral.sh/uv/) for Python environment management, +execute the following commands in the terminal: +```bash +cd ~ +git clone https://github.com/unitreerobotics/unitree_sdk2_python.git +cd unitree_sdk2_python +uv sync +``` + +This creates a local `.venv`, installs the package in editable mode, and +installs the dependencies declared in `pyproject.toml`. Run examples through the +uv-managed environment: +```bash +uv run python ./example/helloworld/publisher.py +``` + +If the `cyclonedds` dependency cannot find your local CycloneDDS installation, +set `CYCLONEDDS_HOME` before running `uv sync`: +```bash +export CYCLONEDDS_HOME=~/cyclonedds/install +uv sync +``` + +### Recommended use from another project +When using this SDK from another project, manage this repository as a Git +submodule instead of copying the source tree. This keeps local changes separate +from upstream updates and makes SDK version updates explicit. + +```bash +git submodule add https://github.com/unitreerobotics/unitree_sdk2_python.git third_party/unitree_sdk2_python +git submodule update --init --recursive +``` + +After cloning a project that already contains this SDK as a submodule, initialize +the submodule before installing: +```bash +git submodule update --init --recursive +uv sync --directory third_party/unitree_sdk2_python +``` + +To update the SDK later, fetch and check out the desired upstream revision inside +the submodule, then commit the updated submodule pointer in the parent project: +```bash +cd third_party/unitree_sdk2_python +git fetch origin +git checkout +cd ../.. +git add third_party/unitree_sdk2_python +git commit -m "Update unitree_sdk2_python submodule" +``` ## FAQ ##### 1. Error when `pip3 install -e .`: ```bash