-
Notifications
You must be signed in to change notification settings - Fork 4
Support rotation counter setting in EncoderMotor class #708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #708 +/- ##
==========================================
- Coverage 61.12% 60.93% -0.20%
==========================================
Files 163 163
Lines 8307 8311 +4
==========================================
- Hits 5078 5064 -14
- Misses 3229 3247 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4b294c5
to
50778c3
Compare
def rotation_counter(self, rotations): | ||
"""Set the rotation counter to a specific rotations value. | ||
This method sets the current odometer reading as the offset, effectively | ||
making the rotation counter value to the value provided. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe:
This method sets the offset to the difference between the current odometer value and the provided rotations value, setting the current rotations counter but having it still change with the odometer.
or:
We use an offset to track the difference between the current odometer value and the user provided rotations value, so that we can report the current rotations relative to this fixed value as they change.
) | ||
|
||
return output_shaft_rotation_counter | ||
|
||
@rotation_counter.setter | ||
def rotation_counter(self, rotations): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think for our learning users it will be easier to understand a method motor.resetRotationCount() than a setter, which looks like a variable to them. resetRotationCount could have basically the same implementation with a defaut of 0 and optional rotations number
Main changes
Screenshots (feature, test output, profiling, dev tools etc)
[insert screenshots here]
Other notes (e.g. implementation quirks, edge cases, questions / issues)
Manual testing tips
Tag anyone who definitely needs to review or help