Skip to content

fix(cli): convert custom calibration directories to Path - #1

Merged
839390315 merged 1 commit into
RadixRootMind:mainfrom
YeDonS:fix/calibration-directory-path
Oct 20, 2026
Merged

839390315 merged 1 commit into
RadixRootMind:mainfrom
YeDonS:fix/calibration-directory-path

Conversation

@YeDonS

@YeDonS YeDonS commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Both SO101 CLI entrypoints pass a non-empty --calibration-dir directly from argparse (a string) into SO101FollowerConfig. The config's Path | None annotation does not coerce it. SOFollower.__init__ then calls Robot.__init__, which executes:

self.calibration_dir.mkdir(parents=True, exist_ok=True)

As a result, supplying a custom calibration directory raises AttributeError: 'str' object has no attribute 'mkdir' before robot connection. The inference entrypoint reaches this after policy initialization.

Convert the value to Path at both configuration boundaries. This makes custom calibration directories usable for calibration and inference. Both files already import Path. Keeping the existing conditional preserves omitted arguments and the explicit empty-string fallback; relative paths retain their existing interpretation.

Validation

On macOS arm64, an isolated harness runs both complete CLI modules with the repository's actual config classes, SOFollower/Robot constructors, MotorCalibration, and calibration-file load/save methods. Python 3.10.20 and 3.12.13 with draccus==0.8.0 each verify 28 scenarios:

Input category Before After
Omitted / empty directory (4 cases) Succeed Succeed
Valid non-empty paths / calibration-file operations (18 cases) mkdir AttributeError Succeed
Invalid directory / malformed JSON (6 cases) mkdir AttributeError masks the actual problem Expected filesystem / JSON errors

Coverage includes relative and absolute paths, spaces, Unicode, existing directories, existing calibration reads without modifying their bytes during initialization, save/reload roundtrips, and custom robot IDs. Compilation and git diff --check pass.

Hardware methods/factories and model/tensor dependencies are stand-ins; the runtime policy loader is replaced and its control loop uses zero steps. This validates path and calibration-file handling; real robot calibration, M50 execution and model performance were not tested.

Reproduction harness, commands and before/after reports: isolated verification bundle.

@839390315
839390315 merged commit 3b44185 into RadixRootMind:main Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants