wpilibsuite / allwpilib

Official Repository of WPILibJ and WPILibC
https://wpilib.org/
Other
1.03k stars 607 forks source link

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

Closed Braykoff closed 2 weeks ago

Braykoff commented 2 weeks ago

Previously, in MotorControllerGroups, calling stopMotor() or disable() stopped all the motors in that group. Now that this class is marked for deprecation, it recommends to use PWMMotorController.addFollower() to create groups. This functionality is not consistent in the PWMMotorController class, where calling either of these methods only applies to that motor, and not its followers. The JavaDocs also specify that the follower motor will follow the outputs of the leader. Thus, it is logical that calling either of these methods should also call them for all of that motor's followers.

This adds that functionality in both Java and C++.

Starlight220 commented 2 weeks ago

If there are additional functions that should be similarly propagated, that should also be done here.