mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilib] Separate ExpansionHubServo into separate Servo and CRServo classes (#8770)
This removes the confusion of the `ExpansionHubServo` class serving both purposes, and thus having a `set` method that functions as `setPosition` when in servo mode and `setThrottle` when not in continuous mode. It also removes the `setContinuousRotationMethod` which 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. --------- Signed-off-by: Zach Harel <zach@zharel.me>
This commit is contained in:
@@ -152,6 +152,7 @@ PWM = "wpi/hardware/discrete/PWM.hpp"
|
||||
|
||||
# wpi/hardware/expansionhub
|
||||
ExpansionHub = "wpi/hardware/expansionhub/ExpansionHub.hpp"
|
||||
ExpansionHubCRServo = "wpi/hardware/expansionhub/ExpansionHubCRServo.hpp"
|
||||
ExpansionHubMotor = "wpi/hardware/expansionhub/ExpansionHubMotor.hpp"
|
||||
ExpansionHubPositionConstants = "wpi/hardware/expansionhub/ExpansionHubPositionConstants.hpp"
|
||||
ExpansionHubServo = "wpi/hardware/expansionhub/ExpansionHubServo.hpp"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
extra_includes:
|
||||
- wpi/hardware/expansionhub/ExpansionHubMotor.hpp
|
||||
- wpi/hardware/expansionhub/ExpansionHubServo.hpp
|
||||
- wpi/hardware/expansionhub/ExpansionHubCRServo.hpp
|
||||
|
||||
classes:
|
||||
wpi::ExpansionHub:
|
||||
@@ -11,6 +12,7 @@ classes:
|
||||
methods:
|
||||
ExpansionHub:
|
||||
MakeServo:
|
||||
MakeCRServo:
|
||||
MakeMotor:
|
||||
IsHubConnected:
|
||||
GetUsbId:
|
||||
|
||||
11
wpilibc/src/main/python/semiwrap/ExpansionHubCRServo.yml
Normal file
11
wpilibc/src/main/python/semiwrap/ExpansionHubCRServo.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
classes:
|
||||
wpi::ExpansionHubCRServo:
|
||||
methods:
|
||||
ExpansionHubCRServo:
|
||||
SetThrottle:
|
||||
SetPulseWidth:
|
||||
SetEnabled:
|
||||
SetFramePeriod:
|
||||
IsHubConnected:
|
||||
SetPWMRange:
|
||||
SetReversed:
|
||||
@@ -2,7 +2,7 @@ classes:
|
||||
wpi::ExpansionHubServo:
|
||||
methods:
|
||||
ExpansionHubServo:
|
||||
Set:
|
||||
SetPosition:
|
||||
SetAngle:
|
||||
SetPulseWidth:
|
||||
SetEnabled:
|
||||
@@ -11,4 +11,3 @@ classes:
|
||||
SetAngleRange:
|
||||
SetPWMRange:
|
||||
SetReversed:
|
||||
SetContinuousRotationMode:
|
||||
|
||||
Reference in New Issue
Block a user