Add shooter interpolation
Includes interpolation values based on testing for at-home challenges
from
https://docs.google.com/document/d/1NR9F-ntlSoqZ9LqDzLjn-c14t8ZrppawCCG7wQy47RU/edit
Change-Id: I094242f43f22da7602f60557a0ec2865a4066875
diff --git a/y2020/constants.cc b/y2020/constants.cc
index b3551aa..07d10ee 100644
--- a/y2020/constants.cc
+++ b/y2020/constants.cc
@@ -34,6 +34,20 @@
::frc971::zeroing::AbsoluteAndAbsoluteEncoderZeroingEstimator>
*const hood = &r->hood;
+ constexpr double kFeetToMeters = 0.0254 * 12.0;
+ // Approximate robot length, for converting estimates from the doc below.
+ // Rounded up from exact estimate, since I'm not sure if the original estimate
+ // includes bumpers.
+ constexpr double kRobotLength = 0.9;
+ // { distance_to_target, { hood_angle, accelerator_power, finisher_power }}
+ // Current settings based on
+ // https://docs.google.com/document/d/1NR9F-ntlSoqZ9LqDzLjn-c14t8ZrppawCCG7wQy47RU/edit
+ r->shot_interpolation_table = InterpolationTable<Values::ShotParams>(
+ {{7.6 * kFeetToMeters - kRobotLength, {0.115, 197.0, 175.0}},
+ {7.6 * kFeetToMeters + kRobotLength, {0.31, 265.0, 235.0}},
+ {12.6 * kFeetToMeters + kRobotLength, {0.4, 292.0, 260.0}},
+ {17.6 * kFeetToMeters + kRobotLength, {0.52, 365.0, 325.0}}});
+
// Hood constants.
hood->zeroing_voltage = 2.0;
hood->operating_voltage = 12.0;