Skip to content

Latest commit

 

History

History
184 lines (136 loc) · 5.35 KB

File metadata and controls

184 lines (136 loc) · 5.35 KB

Comparison: Official Instructions vs Our Setup Script

Official unitree_sdk2_python Installation

From: https://github.com/unitreerobotics/unitree_sdk2_python

Step 1: Build cyclonedds

cd ~
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

Step 2: Install unitree SDK

cd ~/unitree_sdk2_python
export CYCLONEDDS_HOME="~/cyclonedds/install"
pip3 install -e .

Our setup_dependencies.sh Implementation

What We Do Identically

✅ Same cyclonedds clone command
✅ Same cyclonedds branch: releases/0.10.x
✅ Same build directory structure: build install
✅ Same cmake commands
✅ Same CYCLONEDDS_HOME location
✅ Same install method: install -e .

What We Modified (With Good Reasons)

1. Package Manager

Official: pip3 install -e .
Ours: uv pip install -e .

Why: Per your preference, uv pip is faster and we use it consistently throughout the project.

2. Virtual Environment

Official: Installs to system Python
Ours: Activates .venv first, then installs

Why: Best practice - keeps dependencies isolated, prevents conflicts.

3. Environment Variable Syntax

Official: export CYCLONEDDS_HOME="~/cyclonedds/install"
Ours: CYCLONEDDS_HOME="$HOME/cyclonedds/install"

Why:

  • $HOME is more reliable in scripts than ~
  • Inline environment variable works same as export for single command
  • More explicit path expansion

4. Safety Checks

Official: Assumes cyclonedds doesn't exist
Ours: Checks if already installed before cloning

Why: Idempotent - can run script multiple times safely.

5. Additional Steps

Official: Stops after SDK install
Ours: Also installs g1-record-and-replay + tests imports

Why: Complete setup for this project, not just SDK.


Command-by-Command Comparison

Step Official Ours Match?
Clone cyclonedds git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x Same
Create dirs mkdir build install mkdir build install
CMake configure cmake .. -DCMAKE_INSTALL_PREFIX=../install Same
CMake build cmake --build . --target install Same
Set env var export CYCLONEDDS_HOME="~/cyclonedds/install" CYCLONEDDS_HOME="$HOME/cyclonedds/install" ✅ Equivalent
Install SDK pip3 install -e . uv pip install -e . ✅ Equivalent

Are We Following Official Instructions?

✅ YES, with improvements!

Our script:

  1. Follows the exact same build process for cyclonedds
  2. Uses the same installation method for the SDK
  3. Adds safety and convenience features (checks, venv, testing)
  4. Respects your tooling preferences (uv instead of pip)

The Core is Identical

If you strip away our additions (safety checks, venv, tests), the core commands are:

# Official
cd ~
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
cd ~/unitree_sdk2_python
export CYCLONEDDS_HOME="~/cyclonedds/install"
pip3 install -e .

# Ours (core)
cd ~
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
cd ~/projects/g1-piano/unitree_sdk2_python
CYCLONEDDS_HOME="$HOME/cyclonedds/install" uv pip install -e .

Differences: uv pip vs pip3 (user preference), path structure (project-specific)


If You Want Pure Official

If you prefer to follow the official instructions exactly:

# Pure official way (no venv, system pip)
cd ~
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

cd ~/projects/g1-piano/unitree_sdk2_python
export CYCLONEDDS_HOME="~/cyclonedds/install"
pip3 install -e .

cd ~/projects/g1-piano/g1-record-and-replay
pip3 install -e .

Our recommendation: Stick with our script! It:

  • ✅ Follows official core instructions
  • ✅ Adds safety (idempotent)
  • ✅ Uses your preferred tools (uv)
  • ✅ Manages venv properly
  • ✅ Tests the installation
  • ✅ Provides clear feedback

Verification

To verify our implementation matches official expectations:

# After running our script
source .venv/bin/activate
python -c "import unitree_sdk2py; print('SDK installed correctly')"
python -c "import cyclonedds; print(f'cyclonedds version: {cyclonedds.__version__}')"

Expected output:

  • SDK imports successfully
  • cyclonedds version: 0.10.2

This confirms we've installed everything according to the official requirements! ✅


Summary

Question: Does setup_dependencies.sh follow official instructions?
Answer: YES - The core build and install commands are identical. We've added:

  • Safety checks
  • Virtual environment management
  • Use of uv pip (your preference)
  • Testing and verification
  • Better error handling

Bottom line: You're getting the official installation + modern best practices! 🎯