Make zeroing constants structs flatbuffers
This defines all the zeroing structs as flatbuffers and then converts
everything to use the FlatbufferT types.
This is in service of moving zeroing constants into flatbuffers.
Change-Id: Ied7ac78cfcba0f66b4b684fd9e49a49276e55169
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2016/constants.cc b/y2016/constants.cc
index 9284bea..707fa9c 100644
--- a/y2016/constants.cc
+++ b/y2016/constants.cc
@@ -52,22 +52,31 @@
// Intake
{
0.0,
- {Values::kZeroingSampleSize,
- Values::kIntakeEncoderIndexDifference, 0.0, 0.3},
+ {{},
+ Values::kZeroingSampleSize,
+ Values::kIntakeEncoderIndexDifference,
+ 0.0,
+ 0.3},
},
// Shoulder
{
0.0,
- {Values::kZeroingSampleSize,
- Values::kShoulderEncoderIndexDifference, 0.0, 0.3},
+ {{},
+ Values::kZeroingSampleSize,
+ Values::kShoulderEncoderIndexDifference,
+ 0.0,
+ 0.3},
},
// Wrist
{
0.0,
- {Values::kZeroingSampleSize, Values::kWristEncoderIndexDifference,
- 0.0, 0.3},
+ {{},
+ Values::kZeroingSampleSize,
+ Values::kWristEncoderIndexDifference,
+ 0.0,
+ 0.3},
},
0.0,
@@ -84,18 +93,23 @@
// Value to add to the pot reading for the intake.
-4.550531 + 150.40906362 * M_PI / 180.0 + 0.5098 - 0.0178 -
0.0725,
- {Values::kZeroingSampleSize,
+ {{},
+ Values::kZeroingSampleSize,
Values::kIntakeEncoderIndexDifference,
// Location of an index pulse.
- 0.018008, 2.5},
+ 0.018008,
+ 2.5},
},
// Shoulder
{
// Value to add to the pot reading for the shoulder.
-2.86275657117,
- {Values::kZeroingSampleSize,
- Values::kShoulderEncoderIndexDifference, 0.097312, 2.5},
+ {{},
+ Values::kZeroingSampleSize,
+ Values::kShoulderEncoderIndexDifference,
+ 0.097312,
+ 2.5},
},
// Wrist
@@ -104,8 +118,11 @@
3.2390714288298668 + -0.06138835 * M_PI / 180.0 + 0.0078 -
0.0548 - 0.0167 + 0.002 - 0.0026 - 0.1040 - 0.0035 - 0.0012 +
0.0166 - 0.017 + 0.148 + 0.004 + 0.024701 - 0.0741,
- {Values::kZeroingSampleSize, Values::kWristEncoderIndexDifference,
- 0.000820, 2.5},
+ {{},
+ Values::kZeroingSampleSize,
+ Values::kWristEncoderIndexDifference,
+ 0.000820,
+ 2.5},
},
0.0,
@@ -121,16 +138,22 @@
// Hard stop is 160.0185751389329 degrees.
-4.2193 + (160.0185751389329 * M_PI / 180.0 + 0.02 - 0.0235) +
0.0549 - 0.104 + 0.019 - 0.938 + 0.660 - 0.002 - 0.2081,
- {Values::kZeroingSampleSize,
- Values::kIntakeEncoderIndexDifference, 0.332370, 1.3},
+ {{},
+ Values::kZeroingSampleSize,
+ Values::kIntakeEncoderIndexDifference,
+ 0.332370,
+ 1.3},
},
// Shoulder (Now calibrated at 0)
{
-1.0016 - 0.0841 + 0.06138835 * M_PI / 180.0 + 1.07838 - 1.0441 +
0.0034 + 0.0065 - 0.0505,
- {Values::kZeroingSampleSize,
- Values::kShoulderEncoderIndexDifference, 0.027180, 1.3},
+ {{},
+ Values::kZeroingSampleSize,
+ Values::kShoulderEncoderIndexDifference,
+ 0.027180,
+ 1.3},
},
// Wrist
@@ -138,8 +161,11 @@
3.326328571170133 - 0.06138835 * M_PI / 180.0 - 0.177 + 0.0323 -
0.023 + 0.0488 + 0.0120 - 0.0005 - 0.0784 - 0.0010 - 0.080 +
0.1245,
- {Values::kZeroingSampleSize, Values::kWristEncoderIndexDifference,
- -0.263227, 1.3},
+ {{},
+ Values::kZeroingSampleSize,
+ Values::kWristEncoderIndexDifference,
+ -0.263227,
+ 1.3},
},
0.011,