more tuning constants on real hardware
diff --git a/frc971/constants.cc b/frc971/constants.cc
index 3bc8231..ec49293 100755
--- a/frc971/constants.cc
+++ b/frc971/constants.cc
@@ -34,9 +34,9 @@
const ShifterHallEffect kCompLeftDriveShifter{0.83, 2.32, 1.2, 1.0};
const ShifterHallEffect kCompRightDriveShifter{0.865, 2.375, 1.2, 1.0};
-const ShifterHallEffect kPracticeLeftDriveShifter{2.082283, 0.834433, 0.60,
+const ShifterHallEffect kPracticeLeftDriveShifter{5, 0, 0.60,
0.47};
-const ShifterHallEffect kPracticeRightDriveShifter{2.070124, 0.838993, 0.62,
+const ShifterHallEffect kPracticeRightDriveShifter{5, 0, 0.62,
0.55};
const double shooter_zeroing_off_speed=0.0;
const double shooter_zeroing_speed=1.0;
@@ -123,7 +123,9 @@
// TODO(ben): make these real numbers
{-0.000446, 0.300038, -0.001, 0.304354,
0.014436,
- {-2, 0.001786, 0.001786, -2}, {-2, -0.000446, -2, 0.026938}, {0.006096, 0.026416, 0, 0},
+ {-2, 0.001786, 0.001786, -2},
+ {-2, -0.000446, -2, 0.026938},
+ {0.005358, 0.014436, 0.014436, 0.026491},
shooter_zeroing_off_speed,
shooter_zeroing_speed
},
diff --git a/frc971/input/sensor_receiver.cc b/frc971/input/sensor_receiver.cc
index 84ccc70..8c4172d 100644
--- a/frc971/input/sensor_receiver.cc
+++ b/frc971/input/sensor_receiver.cc
@@ -49,13 +49,13 @@
// Translates values from the ADC into voltage.
// TODO(brian): Fix this.
double adc_translate(uint16_t in) {
- static const double kVRefN = 0;
- static const double kVRefP = 3.3;
- static const int kMaximumValue = 0xFFF;
- static const double kDividerGnd = 31.6, kDividerOther = 28;
- return (kVRefN +
- (static_cast<double>(in) / static_cast<double>(kMaximumValue) *
- (kVRefP - kVRefN))) * (kDividerGnd + kDividerOther) / kDividerGnd;
+ static const double kVcc = 5;
+ static const double kR1 = 5, kR2 = 6.65;
+ static const uint16_t kMaximumValue = 0x3FF;
+ return (kVcc *
+ (static_cast<double>(in) / static_cast<double>(kMaximumValue)) -
+ kVcc * kR1) /
+ kR2;
}
double gyro_translate(int64_t in) {
diff --git a/frc971/output/motor_writer.cc b/frc971/output/motor_writer.cc
index 44525cb..6f5ee34 100644
--- a/frc971/output/motor_writer.cc
+++ b/frc971/output/motor_writer.cc
@@ -28,7 +28,7 @@
virtual void RunIteration() {
values_.digital_module = 0;
- values_.pressure_switch_channel = 14;
+ values_.pressure_switch_channel = 1;
values_.compressor_channel = 1;
values_.solenoid_module = 0;