Fix #5: Derive SO-ARM units and safety bounds from use_degrees#22
Conversation
|
@theonlypal happy to take a look again once the tests are fixed! |
|
@jeqcho Hi Jay, the implementation is green. The macOS 3.12 job was rate-limited during setup-uv, before dependencies or pytest ran; ci-ok only mirrors that setup failure. Could you rerun the failed jobs? |
jeqcho
left a comment
There was a problem hiding this comment.
Merging — thanks @theonlypal, this was a pleasure to review.
Two things stood out. The generator-expression trick in test_soarm_normalized_mode_preserves_explicit_degree_sized_limits, keeping the ±180 tuples from aliasing the sentinel, is exactly the care identity-based defaults demand — constant folding would have silently broken a naive version of that test. And the derived ±100 defaults with per-side swapping restore a real safety backstop: the old ±180 clamp simply never fires in normalized space, so this closes an actual gap rather than just widening an input.
One tiny thing I won't hold the merge for: the module docstring in policy.py (around line 21) still says chunks are "(degrees for the joints, 0..100 for the gripper)", which is stale now that normalized mode exists. If you feel like a one-line follow-up it's yours; otherwise we'll sweep it up.
And an apology: the "failing test" I pointed you at earlier turned out to be our CI runner getting rate-limited, not your code. Nothing was ever wrong with the tests. Hope to see more from you.
Description
This PR fixes #5 by supporting LeRobot's normalized motor mode end to end instead of rejecting
use_degrees=False.Previously, the package always declared
joint_posasdeg+normalizedand used degree-mode joint bounds of ±180. Under LeRobot's normalized mode, arm joints are limited to ±100 and the gripper remains 0–100, so the declared state units were incorrect and the default clamp no longer provided an effective backstop.Changes
STATE_SPECwith a state specification derived fromuse_degrees.use_degreestoLeRobotPolicyConfigand thread the setting through both policy and embodiment observation contracts.max_relative_targetin native motor units.Verification
uv lock --checkpasses.use_degrees=Falsedriver configuration.Fixes #5