mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Remove MotorSafetyHelper, create MotorSafety base class instead (#562)
Most of the MotorSafety implementation was moved into the MotorSafety base class. SafePWM's inheritance of MotorSafety was moved into PWM to eliminate Java needing a helper class. In Java, a helper class for Sendable (SendableImpl) was added due to lack of multiple inheritance.
This commit is contained in:
committed by
Peter Johnson
parent
df347e3d80
commit
acb786a791
@@ -18,31 +18,13 @@
|
||||
|
||||
using namespace frc;
|
||||
|
||||
RobotDriveBase::RobotDriveBase() { m_safetyHelper.SetSafetyEnabled(true); }
|
||||
RobotDriveBase::RobotDriveBase() { SetSafetyEnabled(true); }
|
||||
|
||||
void RobotDriveBase::SetDeadband(double deadband) { m_deadband = deadband; }
|
||||
|
||||
void RobotDriveBase::SetMaxOutput(double maxOutput) { m_maxOutput = maxOutput; }
|
||||
|
||||
void RobotDriveBase::FeedWatchdog() { m_safetyHelper.Feed(); }
|
||||
|
||||
void RobotDriveBase::SetExpiration(double timeout) {
|
||||
m_safetyHelper.SetExpiration(timeout);
|
||||
}
|
||||
|
||||
double RobotDriveBase::GetExpiration() const {
|
||||
return m_safetyHelper.GetExpiration();
|
||||
}
|
||||
|
||||
bool RobotDriveBase::IsAlive() const { return m_safetyHelper.IsAlive(); }
|
||||
|
||||
bool RobotDriveBase::IsSafetyEnabled() const {
|
||||
return m_safetyHelper.IsSafetyEnabled();
|
||||
}
|
||||
|
||||
void RobotDriveBase::SetSafetyEnabled(bool enabled) {
|
||||
m_safetyHelper.SetSafetyEnabled(enabled);
|
||||
}
|
||||
void RobotDriveBase::FeedWatchdog() { Feed(); }
|
||||
|
||||
double RobotDriveBase::Limit(double value) {
|
||||
if (value > 1.0) {
|
||||
|
||||
Reference in New Issue
Block a user