Refactor PythonExamples/AHControl to add configuration and unit tests#2
Conversation
1038180 to
e7f59d2
Compare
e7f59d2 to
cb92a8a
Compare
|
|
||
| # Commands | ||
|
|
||
| Run from the project root. If you use pixi for Rust, run `pixi shell` first. Set `PORT` to your serial device (e.g. `/dev/ttyACM0` on Linux, `COM3` on Windows). For canonical calibration use a file under `config/calibration/` (e.g. `config/calibration/r_hand_team_julia.toml`). |
There was a problem hiding this comment.
Are you using Rust vs. just python? or is this for future development?
There was a problem hiding this comment.
Since this is a refactoring, I wanted to make sure all demos (rust + python) still run. We can decide whether we want to use Rust for development. Rust is also new to me.
| ROOT_PATH = Path(os.path.dirname(os.path.abspath(__file__))).parent | ||
|
|
||
| # Per-tip (dx, dy, dz) for pos: result = x*1.5+dx, y*1.5+dy, z*1.5+dz | ||
| MOCAP_POS_OFFSETS = { |
There was a problem hiding this comment.
These are the extractions from the upstream code. For example, here are the original lines of code:
AmazingHand/Demo/AHSimulation/AHSimulation/mj_mink_right.py
Lines 277 to 288 in 0827a8d
and the values are now put under
MOCAP_POS_OFFSETS = {
"right": [
(-0.025, 0.022, 0.098),
(-0.025, -0.009, 0.092),
(-0.025, -0.040, 0.082),
(0.024, 0.019, 0.017),
],
| @@ -0,0 +1,80 @@ | |||
| # Canonical Hand Configuration Design (Proposal) | |||
kbhakt
left a comment
There was a problem hiding this comment.
maybe I missed this, but do you have an automatic linter / check like ruff implemented in this CI pipeline?
Yes, the specifics are in two places. This PR adds a .github/ci.yml, we have The hooks defined in .pre-commit-config.yaml will perform the linting. |
Refactors the Python examples and the AHControl (Rust) stack to use shared, canonical hand configuration where applicable, and adds or extends unit tests. PythonExample demos read serial port, servo IDs, and finger calibration from canonical profiles and calibration files. AHControl supports both canonical calibration (
config/calibration/,config/hand_geometry.toml) and legacy TOML underDemo/AHControl/config/.Configuration
config/profiles.toml(named profiles withport,right_hand_calibration,left_hand_calibration) andconfig/calibration/(one TOML per physical hand with finger sections andrest_deg).AMAZINGHAND_PROFILEto select a profile; default isteam_juliaif unset.Others