mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[wpilib] Fix multiple motor safety issues (#4784)
Java was missing the motor safety thread entirely C++ accidentally used a manual reset event, causing the motor safety thread to spin. C++ PWMMotorController would not feed the watch kitty. Both languages would call feed() from the StopMotor call, causing some ping ponging.
This commit is contained in:
@@ -12,6 +12,7 @@ using namespace frc;
|
||||
|
||||
void PWMMotorController::Set(double speed) {
|
||||
m_pwm.SetSpeed(m_isInverted ? -speed : speed);
|
||||
Feed();
|
||||
}
|
||||
|
||||
double PWMMotorController::Get() const {
|
||||
@@ -31,7 +32,8 @@ void PWMMotorController::Disable() {
|
||||
}
|
||||
|
||||
void PWMMotorController::StopMotor() {
|
||||
Set(0);
|
||||
// Don't use Set(0) as that will feed the watch kitty
|
||||
m_pwm.SetSpeed(0);
|
||||
}
|
||||
|
||||
std::string PWMMotorController::GetDescription() const {
|
||||
|
||||
Reference in New Issue
Block a user