This repository was archived by the owner on Jan 13, 2025. It is now read-only.
update REVThroughBoreDutyCycleEncoder so it gets enough readings to initialize properly#94
Open
dejabot wants to merge 4 commits into
Open
update REVThroughBoreDutyCycleEncoder so it gets enough readings to initialize properly#94dejabot wants to merge 4 commits into
dejabot wants to merge 4 commits into
Conversation
…r, so isConnected() returns when it's had enough readings to initialize
rcahoon
reviewed
Mar 18, 2024
| public REVThroughBoreDutyCycleEncoder(int channel) { | ||
| super(channel); | ||
| setDutyCycleRange(1. / 1025., 1024. / 1025.); | ||
| setConnectedFrequencyThreshold(976 /* 975.6 on spec sheet*/); |
Member
There was a problem hiding this comment.
public boolean isConnected() {
return getFrequency() > m_frequencyThreshold;
}so we might want to be careful about rounding up the threshold (especially since isConnected uses strict greater-than)
Contributor
Author
There was a problem hiding this comment.
ah, I see. at 976, it'll never "spin up".. nice catch. changing to 975.
Member
There was a problem hiding this comment.
please test this a significant number of times on-robot. i would like to make sure that it regularly reaches 976 Hz (or whether we should set the threshold frequency at 974 so that it will allow 975 Hz as well)
…d` will get a chance to report that it's connected.
Contributor
Author
|
thank you! good catch on the strict >. changed threshold to 975. PTAL? |
rcahoon
approved these changes
Mar 18, 2024
4 tasks
4 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
ConnectedFrequencyThresholdforREVThroughBoreDutyCycleEncoderto the right value. this allowsisConnectedto return true only after the encoder has enough readings to initialize properly.Shoulderjust to useisConnectedvs its own initialization timerHow Has This Been Tested?
Needs testing on RevB