[wpilib] Separate ExpansionHubServo into separate Servo and CRServo classes#8770
[wpilib] Separate ExpansionHubServo into separate Servo and CRServo classes#8770zachwaffle4 wants to merge 2 commits intowpilibsuite:2027from
Conversation
| /** | ||
| * 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 |
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
| * 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
| namespace wpi { | ||
| class ExpansionHubCRServo { |
There was a problem hiding this comment.
This new class deserves a doc comment too.
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.