Skip to content

Commit 6ddce9e

Browse files
committed
Update pixi setup on Windows
1 parent abdc199 commit 6ddce9e

9 files changed

Lines changed: 167 additions & 60 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,5 @@ jobs:
2727
- name: Demo unit tests
2828
run: pixi run test-demo
2929

30-
- name: Demo AHSimulation (mj_mink) unit tests
31-
run: pixi run test-demo-mj-mink
32-
3330
- name: AHControl (Rust) unit tests
3431
run: pixi run test-ahcontrol

Demo/README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Running with pixi
44

5-
Prerequisites: install [Pixi](https://pixi.prefix.dev/latest/installation/). Rust is needed for real hardware demos (AHControl).
5+
Prerequisites: install [Pixi](https://pixi.prefix.dev/latest/installation/). Rust is needed for real hardware demos (AHControl). Before running real hardware demos, check the serial port in the dataflow YAML: the default is Linux (`/dev/ttyACM0`); on Windows use your COM port (e.g. `COM3`).
66

7-
From the AmazingHand repository root:
7+
From the AmazingHand repository root (Git Bash on Windows, or a Unix shell on Linux/macOS):
88

99
```bash
1010
pixi install
@@ -32,9 +32,11 @@ pixi run dora build Demo/dataflow_tracking_real.yml # once
3232
pixi run dora run Demo/dataflow_tracking_real.yml
3333
```
3434

35-
The hand config is set in the dataflow YAML (hand_controller `args`): change `--config` and `--serialport` as needed. You can use a legacy file under `AHControl/config/r_hand*.toml` or the repo canonical calibration (e.g. `--config config/calibration/r_hand_team_julia.toml` when running from repo root). See [AHControl](AHControl/README.md) and [canonical_hand_config_design.md](docs/canonical_hand_config_design.md) for details.
35+
The hand config is set in the dataflow YAML (hand_controller `args`): change `--config` and `--serialport` as needed. You can use a legacy file under `AHControl/config/r_hand*.toml` or the repo canonical calibration (e.g. `--config config/calibration/r_hand_team_julia.toml` when running from repo root). See [AHControl](AHControl/README.md) and [canonical_hand_config_design.md](../docs/canonical_hand_config_design.md) for details.
3636

37-
Linux: add your user to the `dialout` group for serial port access: `sudo usermod -a -G dialout $USER` (log out and back in). If your hand is on a different port (e.g. `/dev/ttyUSB0`), edit `Demo/dataflow_tracking_real.yml` and change the `--serialport` arg.
37+
Linux: add your user to the `dialout` group for serial port access: `sudo usermod -a -G dialout $USER` (log out and back in). If your hand is on a different port (e.g. `/dev/ttyUSB0`), edit the dataflow YAML and change the `--serialport` arg.
38+
39+
Windows: before running real hardware demos, edit the dataflow YAML (`dataflow_tracking_real.yml`, `dataflow_tracking_real_team_julia.yml`, or `dataflow_tracking_real_2hands.yml`): set `path` to `target/debug/AHControl.exe` (not `AHControl`), and change `--serialport` to your COM port (e.g. `COM3`). Run `pixi run build-ahcontrol` first to build the binary. To find your COM port: `powershell -c "[System.IO.Ports.SerialPort]::getportnames()"` in Git Bash or PowerShell. Use Git Bash or a shell where pixi is available (see [DEVELOPMENT.md](../docs/DEVELOPMENT.md)).
3840

3941
Finger angle control (simulation):
4042

@@ -45,20 +47,17 @@ pixi run dora run Demo/dataflow_angle_simu.yml
4547

4648
The dataflow `build` steps install HandTracking and AHSimulation in editable mode and build AHControl when needed.
4749

48-
## How to use (uv):
49-
- Install Rust: https://www.rust-lang.org/tools/install
50-
- Install uv: https://docs.astral.sh/uv/getting-started/installation/
51-
- Install dora-rs: https://dora-rs.ai/docs/guides/Installation/installing
52-
- start the daemon: `dora up`
50+
## How to use (uv)
5351

54-
- Clone this repository and in a console from the directory run:
52+
Install [Rust](https://www.rust-lang.org/tools/install), [uv](https://docs.astral.sh/uv/getting-started/installation/), and [dora-rs](https://dora-rs.ai/docs/guides/Installation/installing). Clone the repository, start the daemon (`dora up`), and from the Demo directory run:
5553
- `uv venv --python 3.12`
5654
- To run the webcam hand tracking demo in simulation only:
5755
- `dora build dataflow_tracking_simu.yml --uv` (needs to be done only once)
5856
- `dora run dataflow_tracking_simu.yml --uv`
5957
- To run the webcam hand tracking demo with real hardware:
6058
- `dora build dataflow_tracking_real.yml --uv` (needs to be done only once)
6159
- `dora run dataflow_tracking_real.yml --uv`
60+
- On Windows: edit the dataflow YAML for `path` (use `AHControl.exe`) and `--serialport` (use your COM port) as in the pixi section above.
6261
- To run a simple example to control the finger angles in simulation:
6362
- `dora build dataflow_angle_simu.yml --uv` (needs to be done only once)
6463
- `dora run dataflow_angle_simu.yml --uv`

FORK.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# Fork Notice
1+
# Differences from Upstream
22

3-
This repository is a fork of [pollen-robotics/AmazingHand](https://github.com/pollen-robotics/AmazingHand).
4-
5-
We no longer track or merge from upstream. The fork has diverged to meet our engineering needs: refactoring for effective unit testing, maintainability, and integration with our tooling (pixi, cross-platform support). These changes make regular merges impractical.
6-
7-
If you need specific fixes from upstream, port them manually rather than merging.
3+
See the fork notice in [README.md](README.md). This file is for documenting how this repo differs from [pollen-robotics/AmazingHand](https://github.com/pollen-robotics/AmazingHand) (e.g. layout, tooling, refactors).

PythonExample/README.md

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,19 @@ Use Feetech software to set IDs : [https://github.com/Robot-Maker-SAS/FeetechSer
77

88
## Setup Environment
99

10-
**Install pixi** (if not already installed):
10+
See [DEVELOPMENT.md](../docs/DEVELOPMENT.md) for Pixi installation and full setup. From the repository root (where `pixi.toml` lives), in Git Bash (Windows) or a Unix shell (Linux/macOS):
1111

1212
```bash
13-
curl -fsSL https://pixi.sh/install.sh | bash
14-
```
15-
16-
Restart your shell or run `source ~/.bashrc` (or the equivalent for your shell) so the `pixi` command is available.
17-
18-
**With pixi (recommended)**
19-
From the repository root (where `pixi.toml` lives):
20-
21-
```bash
22-
pixi install # one time setup
23-
# Optional: export AMAZINGHAND_PROFILE=team_julia
13+
pixi install
14+
export AMAZINGHAND_PROFILE=team_julia # optional
2415
pixi run python PythonExample/AmazingHand_FingerTest.py
2516
```
2617

2718
To run another script, replace the filename, e.g. `PythonExample/AmazingHand_Hand_FingerMiddlePos.py` or `PythonExample/AmazingHand_Demo.py`.
2819

29-
Set `AMAZINGHAND_PROFILE` to choose a profile (e.g. `team_julia`, `team_krishan`). Profiles and hand calibration live in `config/profiles.toml` and `config/calibration/`; see [canonical_hand_config_design.md](../docs/canonical_hand_config_design.md). The hand must be connected via USB; the profile's `port` must match your system (e.g. `COM3` on Windows, `/dev/ttyACM0` on Linux). If the port is wrong or the device is unplugged, the script will fail with "No such file or directory".
20+
Profiles and hand calibration live in `config/profiles.toml` and `config/calibration/`; see [canonical_hand_config_design.md](../docs/canonical_hand_config_design.md). The hand must be connected via USB; the profile's `port` must match your system (e.g. `COM3` on Windows, `/dev/ttyACM0` on Linux). To override the port, edit `config/profiles.toml` and change the `port` key in your profile (e.g. `[profile.team_julia]` has `port = "/dev/ttyACM0"`; on Windows use `port = "COM4"` or whatever your device uses).
21+
22+
- To find the COM port on Windows, run `powershell -c "[System.IO.Ports.SerialPort]::getportnames()"` in Git bash shell.
3023

3124
## Run Python Examples
3225

@@ -35,28 +28,10 @@ Set `AMAZINGHAND_PROFILE` to choose a profile (e.g. `team_julia`, `team_krishan`
3528
Runs a loop of gestures (open/close, spread, point, victory, etc.) on one hand. Which hand is controlled by the profile's `hand_test_id` or `side`, or override with `--side`:
3629

3730
```bash
38-
# export AMAZINGHAND_PROFILE=team_julia
3931
pixi run python PythonExample/AmazingHand_Demo.py
40-
# Right hand (1) or left hand (2):
41-
pixi run python PythonExample/AmazingHand_Demo.py --side 1
42-
```
43-
44-
Set `AMAZINGHAND_PROFILE` (e.g. `team_julia`); the profile loads servo IDs and rest/middle positions from `config/calibration/`. See [canonical_hand_config_design.md](../docs/canonical_hand_config_design.md).
45-
46-
## Run Unit Tests
47-
48-
From the repository root:
49-
50-
```bash
51-
pixi run test-demo
32+
pixi run python PythonExample/AmazingHand_Demo.py --side 1 # right (1) or left (2)
5233
```
5334

54-
## Pre-commit (optional)
55-
56-
To run lint and tests before each commit, install the git hooks:
57-
58-
```bash
59-
pixi run pre-commit install
60-
```
35+
Set `AMAZINGHAND_PROFILE` first (see Setup). The profile loads servo IDs and rest/middle positions from `config/calibration/`. See [canonical_hand_config_design.md](../docs/canonical_hand_config_design.md).
6136

62-
Hooks are limited to `PythonExample/`. Run manually with `pixi run pre-commit run --all-files`.
37+
For unit tests and pre-commit, see [maintainer.md](../docs/maintainer.md).

PythonExample/tests/test_common.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Original authors: Pollen Robotics, AmazingHand authors.
2-
# See: https://github.com/pollen-robotics/AmazingHand
3-
#
41
# Copyright (C) 2026 Julia Jia
52
#
63
# Licensed under the Apache License, Version 2.0 (the "License");

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Project is licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
22

3-
43
Mechanical design is licensed under a:
54
[Creative Commons Attribution 4.0 International License][cc-by].
65
[![CC BY 4.0][cc-by-image]][cc-by]
@@ -10,7 +9,15 @@ Mechanical design is licensed under a:
109
[cc-by-image]: https://licensebuttons.net/l/by/4.0/88x31.png
1110
[cc-by-shield]: https://img.shields.io/badge/License-CC%20BY-lightgrey.svg
1211

12+
# Fork Notice
13+
14+
This repository is a fork of [pollen-robotics/AmazingHand](https://github.com/pollen-robotics/AmazingHand). We are grateful to Pollen Robotics for the original project.
15+
16+
We no longer sync with upstream. Our fork has evolved for our own needs: refactoring for unit testing, maintainability, and integration with our tooling (pixi, cross-platform support). The codebases have diverged enough that merging upstream is no longer practical.
17+
18+
If you need changes from the original repo, we recommend porting them by hand. For a summary of how this repo differs from upstream, see [FORK.md](FORK.md).
1319

20+
Below is the original readme content.
1421

1522
# Amazing Hand project
1623

docs/DEVELOPMENT.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Development Workflow
2+
3+
## Table of Contents
4+
5+
- [Prerequisites](#prerequisites)
6+
- [Setup (Linux and Windows)](#setup-linux-and-windows)
7+
- [Setup (Raspberry Pi)](#setup-raspberry-pi)
8+
- [Run Demos](#run-demos)
9+
- [Start Dora Daemon](#start-dora-daemon)
10+
- [Run a simple "finger angle" gesture demo in simulation](#run-a-simple-finger-angle-gesture-demo-in-simulation)
11+
- [Run Python Example](#run-python-example)
12+
- [Run Demo with Physical Hands](#run-demo-with-physical-hands)
13+
- [Appendix](#appendix)
14+
- [Install Microsoft Visual C++ (MSVC) Build Tools](#install-microsoft-visual-c-msvc-build-tools)
15+
16+
## Prerequisites
17+
18+
Install the following tools:
19+
20+
- Install Pixi: https://pixi.prefix.dev/latest/installation/.
21+
- On Windows, to use pixi in Git Bash, add `export PATH="$HOME/.pixi/bin:$PATH"` to `~/.bashrc`, then run `source ~/.bashrc`.
22+
- Verify installation: `pixi --version`
23+
- Rust and cargo are installed via pixi (included in `pixi.toml`).
24+
25+
## Setup (Linux and Windows)
26+
27+
On regular Ubuntu (24.04) or Windows (Windows 11) machine, install the pixi environment (includes all Python dependencies). On Windows, Git Bash is tested.
28+
29+
```bash
30+
# From repository root
31+
pixi install
32+
```
33+
34+
Optionally, verify the installation by running unit tests:
35+
36+
```bash
37+
pixi run test-python-example
38+
pixi run test-demo
39+
pixi run test-ahcontrol
40+
```
41+
42+
Windows only (Rust / test-ahcontrol): `pixi.toml` adds `vs2022_win-64` for win-64, which activates the MSVC toolchain (via vcvars64) when you run `pixi shell` or `pixi run`. You must have Visual Studio or Build Tools installed first (see Appendix). If you get a linker error (e.g. "extra operand", "link.exe not found"), install Build Tools per the Appendix, then run `pixi install` to refresh the environment. As a fallback, run `pixi run test-ahcontrol` from "x64 Native Tools Command Prompt for VS" (Start menu).
43+
44+
## Setup (Raspberry Pi)
45+
Planned and upcoming.
46+
47+
## Run Demos
48+
49+
Tested on Ubuntu 24.04 and Windows 11 (Git Bash).
50+
51+
### Start Dora Daemon
52+
53+
Start the dora daemon using pixi:
54+
55+
```bash
56+
pixi run dora up
57+
```
58+
59+
### Run a simple "finger angle" gesture demo in simulation
60+
61+
This runs `AHSimulation/examples/finger_angle_control.py` and streams targets into the MuJoCo viewer nodes. From the repository root:
62+
63+
```bash
64+
pixi run dora-build-angle-simu # once
65+
pixi run dora-run-angle-simu
66+
```
67+
68+
Note: Dora/MuJoCo demos are tested on Linux and Windows.
69+
70+
Start an interactive shell in the pixi environment:
71+
```bash
72+
pixi shell
73+
```
74+
### Run Python Example
75+
76+
See [PythonExample/README.md](../PythonExample/README.md).
77+
78+
### Run Demo with Physical Hands
79+
80+
See [Demo/README.md](../Demo/README.md). On Linux, add your user to the `dialout` group for serial port access. On Windows, edit the dataflow YAML for the COM port and `AHControl.exe` path.
81+
82+
## Appendix
83+
84+
### Install Microsoft Visual C++ (MSVC) Build Tools
85+
86+
Required for building the Rust crate (`test-ahcontrol`) on Windows. The `vs2022_win-64` package in `pixi.toml` activates this toolchain automatically; you must install Build Tools first. Download and install:
87+
88+
1. Download the Build Tools installer from: https://visualstudio.microsoft.com/visual-cpp-build-tools (or direct: https://aka.ms/vs/17/release/vs_BuildTools.exe).
89+
90+
2. Run `vs_BuildTools.exe`. If the Visual Studio Installer is not installed, it will install first.
91+
92+
3. In the installer, select the workload "Desktop development with C++". This includes the MSVC compiler, linker (`link.exe`), and Windows SDK.
93+
94+
4. On the right-hand "Installation details" panel, ensure "MSVC v143 - VS 2022 C++ x64/x86 build tools" and "Windows 10/11 SDK" (or similar) are checked. Click Install.
95+
96+
5. After installation, run `pixi install` (if needed) and `pixi run test-ahcontrol`. The `vs2022_win-64` package locates your install via vswhere and runs vcvars64 so the correct linker is on PATH.
97+

pixi.lock

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[workspace]
22
name = "amazinghand"
33
version = "0.1.0"
4-
description = "Amazing Hand - Python examples and demos (Pollen Robotics)"
4+
description = "Amazing Hand - Python examples and demos (hardware-fork/Pollen Robotics)"
55
channels = ["conda-forge"]
66
# Ubuntu (x86_64), Windows (x64), Raspberry Pi (aarch64)
77
platforms = ["linux-64", "win-64", "linux-aarch64", "osx-arm64"]
@@ -11,6 +11,10 @@ python = "3.12.*"
1111
pip = "*"
1212
rust = "*"
1313

14+
[target.win-64.dependencies]
15+
# Provides activation that runs vcvars64, putting MSVC link.exe on PATH so Rust finds it (not Git's link)
16+
vs2022_win-64 = "*"
17+
1418
[target.linux-64.activation.env]
1519
# Use system GCC for Rust linking; conda's toolchain can fail with __libc_csu_* symbols on Linux
1620
CC = "/usr/bin/gcc"
@@ -34,8 +38,17 @@ onshape-to-robot = ">=1.7.5"
3438
qpsolvers = { version = ">=4.7.1", extras = ["quadprog"] }
3539

3640
[tasks]
37-
# PYTHONPATH= avoids loading system/ROS pytest plugins when run locally
41+
42+
# Unit test related
43+
# PYTHONPATH= avoids loading system/ROS pytest plugins when run locally (works in Git Bash and Unix)
3844
test-python-example = "cd PythonExample && PYTHONPATH= python -m pytest tests/ -v"
3945
test-demo = "cd Demo && python -m pytest tests/ -v"
40-
test-demo-mj-mink = "python -m pytest Demo/tests/test_mj_mink.py -v"
4146
test-ahcontrol = "cargo test --manifest-path Demo/Cargo.toml -p AHControl"
47+
48+
# build related
49+
build-ahcontrol = "cargo build --release --manifest-path Demo/Cargo.toml -p AHControl"
50+
51+
# dora demos (run from repo root; when used as submodule, use path from parent repo)
52+
dora-build-angle-simu = "dora build Demo/dataflow_angle_simu.yml"
53+
dora-run-angle-simu = "dora run Demo/dataflow_angle_simu.yml"
54+

0 commit comments

Comments
 (0)