Chop out the MotorDanger junk

It had race conditions, and the inheritance hierarchy is a mess.

Change-Id: I4566ee5d7a53ec162c885a70bef3e2774555eef7
diff --git a/third_party/allwpilib_2017/BUILD b/third_party/allwpilib_2017/BUILD
index 054ef08..1903912 100644
--- a/third_party/allwpilib_2017/BUILD
+++ b/third_party/allwpilib_2017/BUILD
@@ -46,6 +46,11 @@
   'ADXRS450_Gyro',
   'GyroBase',
   'IterativeRobot',
+  'MotorSafety',
+  'MotorSafetyHelper',
+  'SafePWM',
+  'SpeedController',
+  'PWMSpeedController',
 ]
 
 # Whole subdirectories of WPILib we don't want around.
diff --git a/third_party/allwpilib_2017/wpilibc/athena/include/Relay.h b/third_party/allwpilib_2017/wpilibc/athena/include/Relay.h
index 6d7f877..de550d2 100644
--- a/third_party/allwpilib_2017/wpilibc/athena/include/Relay.h
+++ b/third_party/allwpilib_2017/wpilibc/athena/include/Relay.h
@@ -11,13 +11,10 @@
 #include <string>
 
 #include "HAL/Types.h"
-#include "MotorSafety.h"
 #include "SensorBase.h"
 
 namespace frc {
 
-class MotorSafetyHelper;
-
 /**
  * Class for Spike style relay outputs.
  * Relays are intended to be connected to spikes or similar relays. The relay
@@ -29,8 +26,7 @@
  * independently for something that does not care about voltage polarity (like
  * a solenoid).
  */
-class Relay : public MotorSafety,
-              public SensorBase {
+class Relay : public SensorBase {
  public:
   enum Value { kOff, kOn, kForward, kReverse };
   enum Direction { kBothDirections, kForwardOnly, kReverseOnly };
@@ -42,22 +38,12 @@
   Value Get() const;
   int GetChannel() const;
 
-  void SetExpiration(double timeout) override;
-  double GetExpiration() const override;
-  bool IsAlive() const override;
-  void StopMotor() override;
-  bool IsSafetyEnabled() const override;
-  void SetSafetyEnabled(bool enabled) override;
-  void GetDescription(std::ostringstream& desc) const override;
-
  private:
   int m_channel;
   Direction m_direction;
 
   HAL_RelayHandle m_forwardHandle = HAL_kInvalidHandle;
   HAL_RelayHandle m_reverseHandle = HAL_kInvalidHandle;
-
-  std::unique_ptr<MotorSafetyHelper> m_safetyHelper;
 };
 
 }  // namespace frc
diff --git a/third_party/allwpilib_2017/wpilibc/athena/include/Talon.h b/third_party/allwpilib_2017/wpilibc/athena/include/Talon.h
index 793d77b..6b8fb7f 100644
--- a/third_party/allwpilib_2017/wpilibc/athena/include/Talon.h
+++ b/third_party/allwpilib_2017/wpilibc/athena/include/Talon.h
@@ -7,14 +7,14 @@
 
 #pragma once
 
-#include "PWMSpeedController.h"
+#include "PWM.h"
 
 namespace frc {
 
 /**
  * Cross the Road Electronics (CTRE) Talon and Talon SR Speed Controller
  */
-class Talon : public PWMSpeedController {
+class Talon : public PWM {
  public:
   explicit Talon(int channel);
   virtual ~Talon() = default;
diff --git a/third_party/allwpilib_2017/wpilibc/athena/src/DriverStation.cpp b/third_party/allwpilib_2017/wpilibc/athena/src/DriverStation.cpp
index 95d20b7..521cf3b 100644
--- a/third_party/allwpilib_2017/wpilibc/athena/src/DriverStation.cpp
+++ b/third_party/allwpilib_2017/wpilibc/athena/src/DriverStation.cpp
@@ -14,7 +14,6 @@
 #include "HAL/HAL.h"
 #include "HAL/Power.h"
 #include "HAL/cpp/Log.h"
-#include "MotorSafetyHelper.h"
 #include "Timer.h"
 #include "Utility.h"
 #include "WPIErrors.h"
@@ -588,7 +587,6 @@
 
 void DriverStation::Run() {
   m_isRunning = true;
-  int period = 0;
   while (m_isRunning) {
     HAL_WaitForDSData();
     GetData();
@@ -602,10 +600,6 @@
     }
     m_waitForDataCond.notify_all();
 
-    if (++period >= 4) {
-      MotorSafetyHelper::CheckMotors();
-      period = 0;
-    }
     if (m_userInDisabled) HAL_ObserveUserProgramDisabled();
     if (m_userInAutonomous) HAL_ObserveUserProgramAutonomous();
     if (m_userInTeleop) HAL_ObserveUserProgramTeleop();
diff --git a/third_party/allwpilib_2017/wpilibc/athena/src/Relay.cpp b/third_party/allwpilib_2017/wpilibc/athena/src/Relay.cpp
index 201963b..3e9597a 100644
--- a/third_party/allwpilib_2017/wpilibc/athena/src/Relay.cpp
+++ b/third_party/allwpilib_2017/wpilibc/athena/src/Relay.cpp
@@ -12,7 +12,6 @@
 
 #include "HAL/HAL.h"
 #include "HAL/Ports.h"
-#include "MotorSafetyHelper.h"
 #include "WPIErrors.h"
 
 using namespace frc;
@@ -82,9 +81,6 @@
       return;
     }
   }
-
-  m_safetyHelper = std::make_unique<MotorSafetyHelper>(this);
-  m_safetyHelper->SetSafetyEnabled(false);
 }
 
 /**
@@ -206,57 +202,3 @@
 }
 
 int Relay::GetChannel() const { return m_channel; }
-
-/**
- * Set the expiration time for the Relay object
- * @param timeout The timeout (in seconds) for this relay object
- */
-void Relay::SetExpiration(double timeout) {
-  m_safetyHelper->SetExpiration(timeout);
-}
-
-/**
- * Return the expiration time for the relay object.
- * @return The expiration time value.
- */
-double Relay::GetExpiration() const { return m_safetyHelper->GetExpiration(); }
-
-/**
- * Check if the relay object is currently alive or stopped due to a timeout.
- *
- * @return a bool value that is true if the motor has NOT timed out and should
- *         still be running.
- */
-bool Relay::IsAlive() const { return m_safetyHelper->IsAlive(); }
-
-/**
- * Stop the motor associated with this PWM object.
- *
- * This is called by the MotorSafetyHelper object when it has a timeout for this
- * relay and needs to stop it from running.
- */
-void Relay::StopMotor() { Set(kOff); }
-
-/**
- * Enable/disable motor safety for this device.
- *
- * Turn on and off the motor safety option for this relay object.
- *
- * @param enabled True if motor safety is enforced for this object
- */
-void Relay::SetSafetyEnabled(bool enabled) {
-  m_safetyHelper->SetSafetyEnabled(enabled);
-}
-
-/**
- * Check if motor safety is enabled for this object.
- *
- * @returns True if motor safety is enforced for this object
- */
-bool Relay::IsSafetyEnabled() const {
-  return m_safetyHelper->IsSafetyEnabled();
-}
-
-void Relay::GetDescription(std::ostringstream& desc) const {
-  desc << "Relay " << GetChannel();
-}
diff --git a/third_party/allwpilib_2017/wpilibc/athena/src/Talon.cpp b/third_party/allwpilib_2017/wpilibc/athena/src/Talon.cpp
index 8143865..ca2e6c3 100644
--- a/third_party/allwpilib_2017/wpilibc/athena/src/Talon.cpp
+++ b/third_party/allwpilib_2017/wpilibc/athena/src/Talon.cpp
@@ -17,7 +17,7 @@
  * @param channel The PWM channel number that the Talon is attached to. 0-9 are
  *                on-board, 10-19 are on the MXP port
  */
-Talon::Talon(int channel) : PWMSpeedController(channel) {
+Talon::Talon(int channel) : PWM(channel) {
   /* Note that the Talon uses the following bounds for PWM values. These values
    * should work reasonably well for most controllers, but if users experience
    * issues such as asymmetric behavior around the deadband or inability to