[wpilib] separate expansionhubservo into separate servo and crservo classes#8770
Open
zachwaffle4 wants to merge 2 commits intowpilibsuite:2027from
Open
[wpilib] separate expansionhubservo into separate servo and crservo classes#8770zachwaffle4 wants to merge 2 commits intowpilibsuite:2027from
zachwaffle4 wants to merge 2 commits intowpilibsuite:2027from
Conversation
Gold856
requested changes
Apr 14, 2026
| /** | ||
| * Sets whether the servo is reversed. | ||
| * | ||
| * This will reverse both Set() and SetAngle(). |
| * by SetAngleRange | ||
| * | ||
| * Servo angles range from 0 to 180 degrees. Use Set() with your own scaler | ||
| * Use Set() with your own scaler |
Member
There was a problem hiding this comment.
Set doesn't exist here anymore. Also reflow the comment and add missing punctuation to the summary.
c597d70 to
e486188
Compare
Gold856
requested changes
Apr 14, 2026
Comment on lines
+29
to
+34
| * Set the servo position. | ||
| * | ||
| * Servo values range from 0.0 to 1.0 corresponding to the range of full left | ||
| * to full right. | ||
| * | ||
| * @param value Position from 0.0 to 1.0. |
Signed-off-by: Zach Harel <zach@zharel.me>
e486188 to
0ad266d
Compare
Supposedly the Servo Hub can switch the modes of REV/goBILDA servos, but I don't know if that ability is implemented at all in revlib or such, or if it's hardware-client-only right now. That said, I wouldn't really expect this to be a thing you would switch mid-opmode, and even if that functionality eventually gets exposed for hardware that supports it, it probably shouldn't be a core WPILib feature. |
# Conflicts: # wpilibc/src/main/native/cpp/hardware/expansionhub/ExpansionHubServo.cpp # wpilibc/src/main/native/include/wpi/hardware/expansionhub/ExpansionHubServo.hpp # wpilibc/src/main/python/semiwrap/ExpansionHubServo.yml # wpilibj/src/main/java/org/wpilib/hardware/expansionhub/ExpansionHubServo.java
Gold856
approved these changes
Apr 14, 2026
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.
This removes the confusion of the
ExpansionHubServoclass serving both purposes, and thus having asetmethod that functions assetPositionwhen in servo mode andsetThrottlewhen not in continuous mode. It also removes thesetContinuousRotationMethodwhich could be confused for a method that switches the actual servo firmware itself from servo to continuous mode, which is not a thing that is physically possible I think.