fixed frc971/constants and all the uses of it

Before, it used aos::robot_state to get the team number, which meant a
lot of complication around dealing with that and the fact that it's not
there at the very beginning. Now, it just uses the IP address to do it,
which means that the interface is way simplier and nicer.
diff --git a/frc971/constants.cc b/frc971/constants.cc
new file mode 100644
index 0000000..76a5f3b
--- /dev/null
+++ b/frc971/constants.cc
@@ -0,0 +1,135 @@
+#include "frc971/constants.h"
+
+#include <math.h>
+#include <stdint.h>
+#include <inttypes.h>
+
+#include "aos/common/logging/logging.h"
+#include "aos/common/once.h"
+#include "aos/common/network/team_number.h"
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
+namespace frc971 {
+namespace constants {
+namespace {
+
+// It has about 0.029043 of gearbox slop.
+// For purposes of moving the end up/down by a certain amount, the wrist is 18
+// inches long.
+const double kCompWristHallEffectStartAngle = 1.285;
+const double kPracticeWristHallEffectStartAngle = 1.175;
+
+const double kWristHallEffectStopAngle = 100 * M_PI / 180.0;
+
+const double kPracticeWristUpperPhysicalLimit = 1.677562;
+const double kCompWristUpperPhysicalLimit = 1.677562;
+
+const double kPracticeWristLowerPhysicalLimit = -0.746128;
+const double kCompWristLowerPhysicalLimit = -0.746128;
+
+const double kPracticeWristUpperLimit = 1.615385;
+const double kCompWristUpperLimit = 1.615385;
+
+const double kPracticeWristLowerLimit = -0.746128;
+const double kCompWristLowerLimit = -0.746128;
+
+const double kWristZeroingSpeed = 0.125;
+const double kWristZeroingOffSpeed = 0.35;
+
+const int kAngleAdjustHallEffect = 2;
+
+// Angle measured from CAD with the top of the angle adjust at the top of the
+// wire guide is 0.773652098 radians.
+
+const double kCompAngleAdjustHallEffectStartAngle[2] = {0.301170496, 1.5};
+const double kPracticeAngleAdjustHallEffectStartAngle[2] = {0.305172594, 1.5};
+
+const double kAngleAdjustHallEffectStopAngle[2] = {0.1, 1.0};
+
+const double kPracticeAngleAdjustUpperPhysicalLimit = 0.904737;
+const double kCompAngleAdjustUpperPhysicalLimit = 0.904737;
+
+const double kPracticeAngleAdjustLowerPhysicalLimit = 0.270;
+const double kCompAngleAdjustLowerPhysicalLimit = 0.302;
+
+const double kPracticeAngleAdjustUpperLimit = 0.87;
+const double kCompAngleAdjustUpperLimit = 0.87;
+
+const double kPracticeAngleAdjustLowerLimit = 0.31;
+const double kCompAngleAdjustLowerLimit = 0.28;
+
+const double kAngleAdjustZeroingSpeed = -0.2;
+const double kAngleAdjustZeroingOffSpeed = -0.5;
+
+const double kPracticeAngleAdjustDeadband = 0.4;
+const double kCompAngleAdjustDeadband = 0.65;
+
+const int kCompCameraCenter = -2;
+const int kPracticeCameraCenter = -5;
+
+const int kCompDrivetrainGearboxPinion = 19;
+const int kPracticeDrivetrainGearboxPinion = 17;
+
+const Values *DoGetValues() {
+  uint16_t team = ::aos::network::GetTeamNumber();
+  LOG(INFO, "creating a Constants for team %" PRIu16 "\n", team);
+  switch (team) {
+    case kCompTeamNumber:
+      return new Values{kCompWristHallEffectStartAngle,
+                        kWristHallEffectStopAngle,
+                        kCompWristUpperLimit,
+                        kCompWristLowerLimit,
+                        kCompWristUpperPhysicalLimit,
+                        kCompWristLowerPhysicalLimit,
+                        kWristZeroingSpeed,
+                        kWristZeroingOffSpeed,
+                        kCompAngleAdjustHallEffectStartAngle,
+                        kAngleAdjustHallEffectStopAngle,
+                        kCompAngleAdjustUpperLimit,
+                        kCompAngleAdjustLowerLimit,
+                        kCompAngleAdjustUpperPhysicalLimit,
+                        kCompAngleAdjustLowerPhysicalLimit,
+                        kAngleAdjustZeroingSpeed,
+                        kAngleAdjustZeroingOffSpeed,
+                        kCompAngleAdjustDeadband,
+                        kCompDrivetrainGearboxPinion,
+                        kCompCameraCenter};
+      break;
+    case kPracticeTeamNumber:
+      return new Values{kPracticeWristHallEffectStartAngle,
+                        kWristHallEffectStopAngle,
+                        kPracticeWristUpperLimit,
+                        kPracticeWristLowerLimit,
+                        kPracticeWristUpperPhysicalLimit,
+                        kPracticeWristLowerPhysicalLimit,
+                        kWristZeroingSpeed,
+                        kWristZeroingOffSpeed,
+                        kPracticeAngleAdjustHallEffectStartAngle,
+                        kAngleAdjustHallEffectStopAngle,
+                        kPracticeAngleAdjustUpperLimit,
+                        kPracticeAngleAdjustLowerLimit,
+                        kPracticeAngleAdjustUpperPhysicalLimit,
+                        kPracticeAngleAdjustLowerPhysicalLimit,
+                        kAngleAdjustZeroingSpeed,
+                        kAngleAdjustZeroingOffSpeed,
+                        kPracticeAngleAdjustDeadband,
+                        kPracticeDrivetrainGearboxPinion,
+                        kPracticeCameraCenter};
+      break;
+    default:
+      LOG(FATAL, "unknown team #%" PRIu16 "\n", team);
+  }
+}
+
+}  // namespace
+
+const Values &GetValues() {
+  static ::aos::Once<const Values> once(DoGetValues);
+  return *once.Get();
+}
+
+}  // namespace constants
+}  // namespace frc971