Mergemaster#145
Merged
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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
positionfield to avoid aborting_callback_motor_statuswith aKeyError. - Add
set_backlash()/get_backlash()helpers for per-axis backlash configuration. - Fix misspelled
accelelerationkey toaccelerationin themove_stepper()payload.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 on lines
+360
to
+361
| idx = self.xyztTo1230(axis) if isinstance(axis, str) else int(axis) | ||
| return float(self.backlash[idx]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.