Skip to content

Clear speed controller history when set_speed is 0 #89

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 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions XRPLib/encoded_motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def set_speed(self, speed_rpm: float = None):
if speed_rpm is None or speed_rpm == 0:
self.target_speed = None
self.set_effort(0)
self.speedController.clear_history()
return
# Convert from rev per min to counts per 20ms (60 sec/min, 50 Hz)
self.target_speed = speed_rpm*self._encoder.resolution/(60*50)
Expand Down