diff --git a/wpilibc/src/main/native/cpp/Drive/RobotDriveBase.cpp b/wpilibc/src/main/native/cpp/Drive/RobotDriveBase.cpp index b21f1c1961..3f04cb6b87 100644 --- a/wpilibc/src/main/native/cpp/Drive/RobotDriveBase.cpp +++ b/wpilibc/src/main/native/cpp/Drive/RobotDriveBase.cpp @@ -40,6 +40,13 @@ void RobotDriveBase::SetDeadband(double deadband) { m_deadband = deadband; } */ void RobotDriveBase::SetMaxOutput(double maxOutput) { m_maxOutput = maxOutput; } +/** + * Feed the motor safety object. Resets the timer that will stop the motors if it completes. + * + * @see MotorSafetyHelper::Feed() + */ +void RobotDriveBase::FeedWatchdog() { m_safetyHelper.Feed(); } + void RobotDriveBase::SetExpiration(double timeout) { m_safetyHelper.SetExpiration(timeout); } diff --git a/wpilibc/src/main/native/include/Drive/RobotDriveBase.h b/wpilibc/src/main/native/include/Drive/RobotDriveBase.h index 892e0a9ffc..5a8952c3bd 100644 --- a/wpilibc/src/main/native/include/Drive/RobotDriveBase.h +++ b/wpilibc/src/main/native/include/Drive/RobotDriveBase.h @@ -47,6 +47,8 @@ class RobotDriveBase : public MotorSafety, public SendableBase { void SetDeadband(double deadband); void SetMaxOutput(double maxOutput); + void FeedWatchdog(); + void SetExpiration(double timeout) override; double GetExpiration() const override; bool IsAlive() const override; diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java index 3804c76f69..8bb5d03aad 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java @@ -67,6 +67,15 @@ public abstract class RobotDriveBase extends SendableBase implements MotorSafety m_maxOutput = maxOutput; } + /** + * Feed the motor safety object. Resets the timer that will stop the motors if it completes. + * + * @see MotorSafetyHelper#feed() + */ + public void feedWatchdog() { + m_safetyHelper.feed(); + } + @Override public void setExpiration(double timeout) { m_safetyHelper.setExpiration(timeout);