Skip to content

Mergemaster#145

Merged
beniroquai merged 2 commits into
masterfrom
mergemaster
Jul 1, 2026
Merged

Mergemaster#145
beniroquai merged 2 commits into
masterfrom
mergemaster

Conversation

@beniroquai

Copy link
Copy Markdown
Contributor

No description provided.

Avoid KeyError and stale positions when intermediate status frames arrive that only contain {stepperid, isDone}: inspect each stepper dict and continue if "position" is missing, and use a local `stepper` variable for clarity. Also add `set_backlash(axis, backlash)` and `get_backlash(axis)` helpers (with docstrings) to read/set per-axis backlash in hardware steps; they accept axis name or index and return the stored value. These changes improve robustness of position callbacks and provide a small public API for backlash handling.
Copilot AI review requested due to automatic review settings July 1, 2026 05:47
@beniroquai beniroquai merged commit 2c1a400 into master Jul 1, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the motor control layer to be more resilient to partial status frames from firmware, exposes backlash as a first-class per-axis setting, and fixes an acceleration key typo in the motor action payload.

Changes:

  • Skip intermediate motor status frames that don’t include a position field to avoid aborting _callback_motor_status with a KeyError.
  • Add set_backlash() / get_backlash() helpers for per-axis backlash configuration.
  • Fix misspelled acceleleration key to acceleration in the move_stepper() payload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread uc2rest/motor.py
Comment on lines +354 to +356
idx = self.xyztTo1230(axis) if isinstance(axis, str) else int(axis)
self.backlash[idx] = backlash
return float(self.backlash[idx])
Comment thread uc2rest/motor.py
Comment on lines +360 to +361
idx = self.xyztTo1230(axis) if isinstance(axis, str) else int(axis)
return float(self.backlash[idx])
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