mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
This adds StopMotor() to the SpeedController interface for C++ and Java.
For Java, this is as simple as just adding it, as all motors already have an implementation from MotorSafety that is correctly resolved. For C++, I had to override StopMotor in the classes that descend from SafePWM and explicitly call the SafePWM version. RobotDrive now calls StopMotor on each of its SpeedControllers, instead of calling Disable or setting the motor to 0.0 as it was doing previously. Additional small formatting corrections to the previous commit starting this were added. Change-Id: Ie94565394927a910ce74bc628670ac3d658d8df9
This commit is contained in:
committed by
Brad Miller (WPI)
parent
91c5db06db
commit
952ebb11ad
@@ -86,3 +86,8 @@ void VictorSP::Disable() { SetRaw(kPwmDisabled); }
|
||||
* @param output Write out the PWM value as was found in the PIDController
|
||||
*/
|
||||
void VictorSP::PIDWrite(float output) { Set(output); }
|
||||
|
||||
/**
|
||||
* Common interface to stop the motor until Set is called again.
|
||||
*/
|
||||
void VictorSP::StopMotor() { this->SafePWM::StopMotor(); }
|
||||
Reference in New Issue
Block a user