Skip to content
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
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <commit-or-tag>
cd ../..
git add third_party/unitree_sdk2_python
git commit -m "Update unitree_sdk2_python submodule"
```
## FAQ
##### 1. Error when `pip3 install -e .`:
```bash
Expand Down
24 changes: 23 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
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.*"]