[wpilib] Propagate PWMMotorController stopMotor() and disable() to followers (#6750)

This commit is contained in:
Brendan Raykoff
2024-06-18 09:40:32 -04:00
committed by GitHub
parent 3a0ee5c9a7
commit e884221a8d
2 changed files with 22 additions and 0 deletions

View File

@@ -47,11 +47,25 @@ bool PWMMotorController::GetInverted() const {
void PWMMotorController::Disable() {
m_pwm.SetDisabled();
for (auto& follower : m_nonowningFollowers) {
follower->Disable();
}
for (auto& follower : m_owningFollowers) {
follower->Disable();
}
}
void PWMMotorController::StopMotor() {
// Don't use Set(0) as that will feed the watch kitty
m_pwm.SetSpeed(0);
for (auto& follower : m_nonowningFollowers) {
follower->StopMotor();
}
for (auto& follower : m_owningFollowers) {
follower->StopMotor();
}
}
std::string PWMMotorController::GetDescription() const {