Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jcapona
Copy link
Contributor

@jcapona jcapona commented Jul 14, 2025

Status Ticket/Issue
Ready/Hold Ticket

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

Copy link

codecov bot commented Jul 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.93%. Comparing base (b74cc9b) to head (5cd9541).

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     
Flag Coverage Δ
unittests 60.93% <100.00%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jcapona jcapona force-pushed the set-encoder-rotation-counter branch from 4b294c5 to 50778c3 Compare July 14, 2025 23:02
@jcapona jcapona marked this pull request as ready for review July 15, 2025 14:02
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.
Copy link
Contributor

@angusjfw angusjfw Jul 15, 2025

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):
Copy link
Contributor

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

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