milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 1 | #include "y2022/constants.h" |
| 2 | |
| 3 | #include <cinttypes> |
| 4 | #include <map> |
| 5 | |
| 6 | #if __has_feature(address_sanitizer) |
| 7 | #include "sanitizer/lsan_interface.h" |
| 8 | #endif |
| 9 | |
| 10 | #include "absl/base/call_once.h" |
| 11 | #include "aos/mutex/mutex.h" |
| 12 | #include "aos/network/team_number.h" |
| 13 | #include "glog/logging.h" |
Austin Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 14 | #include "y2022/control_loops/superstructure/catapult/integral_catapult_plant.h" |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 15 | #include "y2022/control_loops/superstructure/climber/integral_climber_plant.h" |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 16 | #include "y2022/control_loops/superstructure/intake/integral_intake_plant.h" |
| 17 | #include "y2022/control_loops/superstructure/turret/integral_turret_plant.h" |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 18 | |
| 19 | namespace y2022 { |
| 20 | namespace constants { |
| 21 | |
| 22 | const int Values::kZeroingSampleSize; |
| 23 | |
| 24 | namespace { |
| 25 | |
| 26 | const uint16_t kCompTeamNumber = 971; |
| 27 | const uint16_t kPracticeTeamNumber = 9971; |
| 28 | const uint16_t kCodingRobotTeamNumber = 7971; |
| 29 | |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 30 | } // namespace |
| 31 | |
| 32 | Values MakeValues(uint16_t team) { |
| 33 | LOG(INFO) << "creating a Constants for team: " << team; |
| 34 | |
| 35 | Values r; |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 36 | |
Yash Chainani | 997a749 | 2022-01-29 15:48:56 -0800 | [diff] [blame] | 37 | // Intake constants. |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 38 | auto *const intake_front = &r.intake_front; |
| 39 | auto *const intake_back = &r.intake_back; |
Yash Chainani | 997a749 | 2022-01-29 15:48:56 -0800 | [diff] [blame] | 40 | |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 41 | ::frc971::control_loops::StaticZeroingSingleDOFProfiledSubsystemParams< |
| 42 | ::frc971::zeroing::PotAndAbsoluteEncoderZeroingEstimator> |
| 43 | intake_params; |
| 44 | |
| 45 | intake_params.zeroing_voltage = 3.0; |
| 46 | intake_params.operating_voltage = 12.0; |
| 47 | intake_params.zeroing_profile_params = {0.5, 3.0}; |
| 48 | intake_params.default_profile_params = {6.0, 30.0}; |
| 49 | intake_params.range = Values::kIntakeRange(); |
| 50 | intake_params.make_integral_loop = |
Yash Chainani | 997a749 | 2022-01-29 15:48:56 -0800 | [diff] [blame] | 51 | control_loops::superstructure::intake::MakeIntegralIntakeLoop; |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 52 | intake_params.zeroing_constants.average_filter_size = |
| 53 | Values::kZeroingSampleSize; |
| 54 | intake_params.zeroing_constants.one_revolution_distance = |
Yash Chainani | 997a749 | 2022-01-29 15:48:56 -0800 | [diff] [blame] | 55 | M_PI * 2.0 * constants::Values::kIntakeEncoderRatio(); |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 56 | intake_params.zeroing_constants.zeroing_threshold = 0.0005; |
| 57 | intake_params.zeroing_constants.moving_buffer_size = 20; |
| 58 | intake_params.zeroing_constants.allowable_encoder_error = 0.9; |
| 59 | intake_params.zeroing_constants.measured_absolute_position = 0.0; |
Yash Chainani | 997a749 | 2022-01-29 15:48:56 -0800 | [diff] [blame] | 60 | |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 61 | intake_front->subsystem_params = intake_params; |
| 62 | intake_back->subsystem_params = intake_params; |
Yash Chainani | 997a749 | 2022-01-29 15:48:56 -0800 | [diff] [blame] | 63 | |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 64 | // Turret constants. |
| 65 | auto *const turret = &r.turret; |
| 66 | auto *const turret_params = &turret->subsystem_params; |
Milind Upadhyay | e9075d1 | 2022-04-12 22:45:16 -0700 | [diff] [blame] | 67 | auto *turret_range = &r.turret_range; |
| 68 | |
| 69 | *turret_range = ::frc971::constants::Range{ |
| 70 | .lower_hard = -7.0, // Back Hard |
| 71 | .upper_hard = 3.4, // Front Hard |
| 72 | .lower = -6.5, // Back Soft |
| 73 | .upper = 3.15 // Front Soft |
| 74 | }; |
Yash Chainani | 997a749 | 2022-01-29 15:48:56 -0800 | [diff] [blame] | 75 | |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 76 | turret_params->zeroing_voltage = 4.0; |
Austin Schuh | 798be92 | 2022-03-12 12:00:41 -0800 | [diff] [blame] | 77 | turret_params->operating_voltage = 12.0; |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 78 | turret_params->zeroing_profile_params = {0.5, 2.0}; |
milind-u | c63d094 | 2022-04-15 12:07:42 -0700 | [diff] [blame] | 79 | turret_params->default_profile_params = {10.0, 20.0}; |
Milind Upadhyay | e9075d1 | 2022-04-12 22:45:16 -0700 | [diff] [blame] | 80 | turret_params->default_profile_params = {15.0, 20.0}; |
| 81 | turret_params->range = *turret_range; |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 82 | turret_params->make_integral_loop = |
| 83 | control_loops::superstructure::turret::MakeIntegralTurretLoop; |
| 84 | turret_params->zeroing_constants.average_filter_size = |
| 85 | Values::kZeroingSampleSize; |
| 86 | turret_params->zeroing_constants.one_revolution_distance = |
| 87 | M_PI * 2.0 * constants::Values::kTurretEncoderRatio(); |
| 88 | turret_params->zeroing_constants.zeroing_threshold = 0.0005; |
| 89 | turret_params->zeroing_constants.moving_buffer_size = 20; |
| 90 | turret_params->zeroing_constants.allowable_encoder_error = 0.9; |
| 91 | turret_params->zeroing_constants.measured_absolute_position = 0.0; |
Yash Chainani | 997a749 | 2022-01-29 15:48:56 -0800 | [diff] [blame] | 92 | |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 93 | // Climber constants |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 94 | auto *const climber = &r.climber; |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 95 | climber->subsystem_params.zeroing_voltage = 3.0; |
| 96 | climber->subsystem_params.operating_voltage = 12.0; |
| 97 | climber->subsystem_params.zeroing_profile_params = {0.5, 0.1}; |
Austin Schuh | 8507c9f | 2022-03-13 18:08:28 -0700 | [diff] [blame] | 98 | climber->subsystem_params.default_profile_params = {5.0, 1.0}; |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 99 | climber->subsystem_params.range = Values::kClimberRange(); |
| 100 | climber->subsystem_params.make_integral_loop = |
| 101 | control_loops::superstructure::climber::MakeIntegralClimberLoop; |
| 102 | |
Griffin Bui | bcbef48 | 2022-02-23 15:32:10 -0800 | [diff] [blame] | 103 | // Flipper arm constants |
| 104 | Values::PotConstants flipper_arms; |
| 105 | flipper_arms.subsystem_params.zeroing_voltage = 3.0; |
| 106 | flipper_arms.subsystem_params.operating_voltage = 12.0; |
| 107 | flipper_arms.subsystem_params.zeroing_profile_params = {0.5, 0.1}; |
| 108 | flipper_arms.subsystem_params.default_profile_params = {6.0, 1.0}; |
| 109 | flipper_arms.subsystem_params.range = Values::kFlipperArmRange(); |
| 110 | |
Austin Schuh | e18df6d | 2022-03-05 14:02:03 -0800 | [diff] [blame] | 111 | auto *const flipper_arm_right = &r.flipper_arm_right; |
| 112 | auto *const flipper_arm_left = &r.flipper_arm_left; |
Griffin Bui | bcbef48 | 2022-02-23 15:32:10 -0800 | [diff] [blame] | 113 | |
| 114 | *flipper_arm_right = flipper_arms; |
| 115 | *flipper_arm_left = flipper_arms; |
| 116 | |
| 117 | // No integral loops for flipper arms |
| 118 | |
Austin Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 119 | // Catapult |
| 120 | Values::PotAndAbsEncoderConstants *const catapult = &r.catapult; |
| 121 | ::frc971::control_loops::StaticZeroingSingleDOFProfiledSubsystemParams< |
| 122 | ::frc971::zeroing::PotAndAbsoluteEncoderZeroingEstimator> |
| 123 | *const catapult_params = &catapult->subsystem_params; |
| 124 | |
| 125 | catapult_params->zeroing_voltage = 4.0; |
| 126 | catapult_params->operating_voltage = 12.0; |
| 127 | catapult_params->zeroing_profile_params = {0.5, 2.0}; |
| 128 | catapult_params->default_profile_params = {15.0, 40.0}; |
| 129 | catapult_params->range = Values::kCatapultRange(); |
| 130 | catapult_params->make_integral_loop = |
| 131 | &control_loops::superstructure::catapult::MakeIntegralCatapultLoop; |
| 132 | catapult_params->zeroing_constants.average_filter_size = |
| 133 | Values::kZeroingSampleSize; |
| 134 | catapult_params->zeroing_constants.one_revolution_distance = |
| 135 | M_PI * 2.0 * constants::Values::kCatapultEncoderRatio(); |
| 136 | catapult_params->zeroing_constants.zeroing_threshold = 0.0005; |
| 137 | catapult_params->zeroing_constants.moving_buffer_size = 20; |
| 138 | catapult_params->zeroing_constants.allowable_encoder_error = 0.9; |
| 139 | |
Ravago Jones | 3283ce0 | 2022-03-09 19:31:29 -0800 | [diff] [blame] | 140 | // Interpolation table for comp and practice robots |
| 141 | r.shot_interpolation_table = InterpolationTable<Values::ShotParams>({ |
Austin Schuh | 9628b8b | 2022-04-16 10:18:59 -0700 | [diff] [blame] | 142 | {1.0, {0.05, 19.4}}, |
| 143 | {1.6, {0.05, 19.4}}, |
| 144 | {1.9, {0.1, 19.4}}, |
| 145 | {2.12, {0.13, 19.4}}, |
| 146 | {2.9, {0.24, 19.9}}, |
Austin Schuh | 1ed66ab | 2022-04-02 22:39:17 -0700 | [diff] [blame] | 147 | |
Austin Schuh | 9628b8b | 2022-04-16 10:18:59 -0700 | [diff] [blame] | 148 | {3.2, {0.26, 20.7}}, |
| 149 | |
| 150 | {3.60, {0.33, 20.9}}, |
| 151 | {4.50, {0.38, 22.5}}, |
| 152 | {4.9, {0.4, 22.9}}, |
James Kuszmaul | b9ba9a5 | 2022-03-31 22:16:01 -0700 | [diff] [blame] | 153 | {5.4, {0.4, 23.9}}, |
Austin Schuh | 1ed66ab | 2022-04-02 22:39:17 -0700 | [diff] [blame] | 154 | |
Austin Schuh | 9628b8b | 2022-04-16 10:18:59 -0700 | [diff] [blame] | 155 | {6.0, {0.40, 25.4}}, |
| 156 | {7.0, {0.37, 28.1}}, |
| 157 | |
| 158 | {10.0, {0.37, 28.1}}, |
Ravago Jones | 3283ce0 | 2022-03-09 19:31:29 -0800 | [diff] [blame] | 159 | }); |
| 160 | |
James Kuszmaul | b9ba9a5 | 2022-03-31 22:16:01 -0700 | [diff] [blame] | 161 | if (false) { |
| 162 | // 1.5 meters -> 2.7 |
| 163 | // 2.3 meters -> 4.7 |
| 164 | // 4.5 meters -> 7.0 |
| 165 | // 7.0 meters -> 9.0 |
| 166 | |
| 167 | constexpr double kShotVelocity = 9.0; |
| 168 | r.shot_velocity_interpolation_table = |
| 169 | InterpolationTable<Values::ShotVelocityParams>({ |
| 170 | {1.0, {kShotVelocity}}, |
| 171 | {10.0, {kShotVelocity}}, |
| 172 | }); |
| 173 | } else { |
| 174 | r.shot_velocity_interpolation_table = |
| 175 | InterpolationTable<Values::ShotVelocityParams>({ |
| 176 | {1.0, {2.7}}, |
| 177 | {1.5, {2.7}}, |
| 178 | {2.3, {4.7}}, |
| 179 | {4.5, {7.0}}, |
| 180 | {7.0, {9.0}}, |
| 181 | {10.0, {9.0}}, |
| 182 | }); |
| 183 | } |
| 184 | |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 185 | switch (team) { |
| 186 | // A set of constants for tests. |
| 187 | case 1: |
Ravago Jones | 3283ce0 | 2022-03-09 19:31:29 -0800 | [diff] [blame] | 188 | r.shot_interpolation_table = InterpolationTable<Values::ShotParams>({ |
| 189 | {2, {0.08, 8.0}}, |
| 190 | {5, {0.6, 10.0}}, |
| 191 | }); |
| 192 | |
James Kuszmaul | b9ba9a5 | 2022-03-31 22:16:01 -0700 | [diff] [blame] | 193 | r.shot_velocity_interpolation_table = |
| 194 | InterpolationTable<Values::ShotVelocityParams>({ |
| 195 | {2, {2.0}}, |
| 196 | {5, {4.0}}, |
| 197 | }); |
| 198 | |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 199 | climber->potentiometer_offset = 0.0; |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 200 | intake_front->potentiometer_offset = 0.0; |
| 201 | intake_front->subsystem_params.zeroing_constants |
| 202 | .measured_absolute_position = 0.0; |
| 203 | intake_back->potentiometer_offset = 0.0; |
| 204 | intake_back->subsystem_params.zeroing_constants |
| 205 | .measured_absolute_position = 0.0; |
| 206 | turret->potentiometer_offset = 0.0; |
| 207 | turret->subsystem_params.zeroing_constants.measured_absolute_position = |
| 208 | 0.0; |
Griffin Bui | bcbef48 | 2022-02-23 15:32:10 -0800 | [diff] [blame] | 209 | flipper_arm_left->potentiometer_offset = 0.0; |
| 210 | flipper_arm_right->potentiometer_offset = 0.0; |
Austin Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 211 | |
| 212 | catapult_params->zeroing_constants.measured_absolute_position = 0.0; |
| 213 | catapult->potentiometer_offset = 0.0; |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 214 | break; |
| 215 | |
| 216 | case kCompTeamNumber: |
milind-u | 6e7d8d4 | 2022-04-06 18:30:43 -0700 | [diff] [blame] | 217 | climber->potentiometer_offset = -0.0463847608752 - 0.0376876182111 + |
| 218 | 0.0629263851579 - 0.00682128836400001 + |
Austin Schuh | 69379ac | 2022-04-29 21:27:05 -0700 | [diff] [blame] | 219 | 0.0172237531191 - 0.0172237531191 + |
| 220 | 0.00443383743660001 - 0.0117667224279; |
Austin Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 221 | |
Austin Schuh | 41ebf1e | 2022-03-27 14:12:49 -0700 | [diff] [blame] | 222 | intake_front->potentiometer_offset = |
Austin Schuh | 69379ac | 2022-04-29 21:27:05 -0700 | [diff] [blame] | 223 | 2.79628370453323 - 0.0250288114832881 + 0.577152542437606 + |
| 224 | 0.476513825677792 - 0.47869991531664 + 0.50529913945481 - |
| 225 | 0.796768714398522 + 0.163696825540674 - 0.0963353449092312; |
Austin Schuh | 275f981 | 2022-03-05 14:02:37 -0800 | [diff] [blame] | 226 | intake_front->subsystem_params.zeroing_constants |
Austin Schuh | 69379ac | 2022-04-29 21:27:05 -0700 | [diff] [blame] | 227 | .measured_absolute_position = 0.175014091275898; |
Austin Schuh | 275f981 | 2022-03-05 14:02:37 -0800 | [diff] [blame] | 228 | |
Austin Schuh | 463abe2 | 2022-04-15 19:15:49 -0700 | [diff] [blame] | 229 | intake_back->potentiometer_offset = |
| 230 | 3.1409576474047 + 0.278653334013286 + 0.00879137908308503 + |
Austin Schuh | 69379ac | 2022-04-29 21:27:05 -0700 | [diff] [blame] | 231 | 0.0837134053818833 + 0.832945730100298 - 0.00759895654985426 - |
| 232 | 2.03114758819475 + 0.318379597392509 + 0.675664531140745 + |
| 233 | 0.0650864893911517; |
Austin Schuh | 275f981 | 2022-03-05 14:02:37 -0800 | [diff] [blame] | 234 | intake_back->subsystem_params.zeroing_constants |
Austin Schuh | 69379ac | 2022-04-29 21:27:05 -0700 | [diff] [blame] | 235 | .measured_absolute_position = 0.0517274215962501; |
Austin Schuh | 275f981 | 2022-03-05 14:02:37 -0800 | [diff] [blame] | 236 | |
milind-u | c63d094 | 2022-04-15 12:07:42 -0700 | [diff] [blame] | 237 | turret->potentiometer_offset = |
| 238 | -9.99970387166721 + 0.06415943 + 0.073290115367682 - |
| 239 | 0.0634440443622909 + 0.213601224728352 + 0.0657973101027296 - |
| 240 | 0.114726411377978 - 0.980314029089968 - 0.0266013159299456 + |
Austin Schuh | 69379ac | 2022-04-29 21:27:05 -0700 | [diff] [blame] | 241 | 0.0631240002215899 + 0.222882504808653 + 0.0370686419434252 - |
| 242 | 0.0965027214840068 - 0.126737479717192; |
Austin Schuh | 275f981 | 2022-03-05 14:02:37 -0800 | [diff] [blame] | 243 | turret->subsystem_params.zeroing_constants.measured_absolute_position = |
Austin Schuh | 69379ac | 2022-04-29 21:27:05 -0700 | [diff] [blame] | 244 | 1.3081068967929; |
Austin Schuh | 275f981 | 2022-03-05 14:02:37 -0800 | [diff] [blame] | 245 | |
| 246 | flipper_arm_left->potentiometer_offset = -6.4; |
Austin Schuh | 6b1e4d9 | 2022-03-12 12:02:46 -0800 | [diff] [blame] | 247 | flipper_arm_right->potentiometer_offset = 5.56; |
Austin Schuh | 275f981 | 2022-03-05 14:02:37 -0800 | [diff] [blame] | 248 | |
| 249 | catapult_params->zeroing_constants.measured_absolute_position = |
| 250 | 1.71723370408082; |
| 251 | catapult->potentiometer_offset = -2.03383240293769; |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 252 | break; |
| 253 | |
| 254 | case kPracticeTeamNumber: |
Milind Upadhyay | d02ae80 | 2022-09-21 09:33:48 -0700 | [diff] [blame] | 255 | r.shot_interpolation_table = InterpolationTable<Values::ShotParams>({ |
| 256 | {1.0, {0.08, 20.0}}, |
| 257 | {1.6, {0.08, 20.0}}, |
| 258 | {1.9, {0.11, 20.0}}, |
| 259 | {2.12, {0.15, 20.5}}, |
| 260 | {2.9, {0.27, 20.2}}, |
| 261 | |
| 262 | {3.2, {0.29, 20.6}}, |
| 263 | |
| 264 | {3.60, {0.36, 21.0}}, |
| 265 | {4.50, {0.41, 22.7}}, |
| 266 | {4.9, {0.42, 23.3}}, |
| 267 | {5.4, {0.42, 24.6}}, |
| 268 | |
| 269 | {6.0, {0.42, 26.25}}, |
| 270 | {7.0, {0.39, 28.25}}, |
| 271 | |
| 272 | {10.0, {0.39, 28.25}}, |
| 273 | }); |
| 274 | |
Milind Upadhyay | e9075d1 | 2022-04-12 22:45:16 -0700 | [diff] [blame] | 275 | // TODO(milind): calibrate once mounted |
Milind Upadhyay | da48247 | 2022-09-23 18:04:05 -0700 | [diff] [blame] | 276 | climber->potentiometer_offset = -0.1209073362519 + 0.0760598; |
Milind Upadhyay | a10e5e0 | 2022-09-10 22:57:25 -0700 | [diff] [blame] | 277 | intake_front->potentiometer_offset = 3.06604378582351 - 0.60745632979918; |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 278 | intake_front->subsystem_params.zeroing_constants |
Milind Upadhyay | a10e5e0 | 2022-09-10 22:57:25 -0700 | [diff] [blame] | 279 | .measured_absolute_position = 0.143667561169188; |
Milind Upadhyay | ac29d02 | 2022-09-24 20:43:52 -0700 | [diff] [blame] | 280 | intake_back->potentiometer_offset = 3.10861174832838 + 0.431432052414186 - |
| 281 | 0.171422335492571 + |
| 282 | 0.0414174770317617; |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 283 | intake_back->subsystem_params.zeroing_constants |
Milind Upadhyay | ac29d02 | 2022-09-24 20:43:52 -0700 | [diff] [blame] | 284 | .measured_absolute_position = 0.33350955486723; |
Milind Upadhyay | 4e9f260 | 2022-09-22 14:47:54 -0700 | [diff] [blame] | 285 | |
Milind Upadhyay | ac29d02 | 2022-09-24 20:43:52 -0700 | [diff] [blame] | 286 | turret->potentiometer_offset = |
| 287 | -8.14418207451834 + 0.342635491808218 - 0.944807955598189 - |
| 288 | 0.0718028442723373 - 0.0793332946417493 + 0.233707527214682 + |
| 289 | 0.0828349540635251 + 0.677740533247017 - 0.0828349540635251 - |
| 290 | 0.0903654044329345 - 0.105426305171759 - 0.150609007388226 - |
| 291 | 0.0338870266623506; |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 292 | turret->subsystem_params.zeroing_constants.measured_absolute_position = |
Milind Upadhyay | ac29d02 | 2022-09-24 20:43:52 -0700 | [diff] [blame] | 293 | 1.43911620174213; |
Milind Upadhyay | 4e9f260 | 2022-09-22 14:47:54 -0700 | [diff] [blame] | 294 | turret_range->upper = 2.9; |
| 295 | turret_range->lower = -6.4; |
Milind Upadhyay | e9075d1 | 2022-04-12 22:45:16 -0700 | [diff] [blame] | 296 | turret_params->range = *turret_range; |
| 297 | flipper_arm_left->potentiometer_offset = -4.39536583413615; |
| 298 | flipper_arm_right->potentiometer_offset = 4.36264091401229; |
Austin Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 299 | |
Milind Upadhyay | e9075d1 | 2022-04-12 22:45:16 -0700 | [diff] [blame] | 300 | catapult_params->zeroing_constants.measured_absolute_position = |
| 301 | 1.62909518684227; |
| 302 | catapult->potentiometer_offset = -1.52951814169821 - 0.0200812009850977; |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 303 | break; |
| 304 | |
| 305 | case kCodingRobotTeamNumber: |
Ravago Jones | 3283ce0 | 2022-03-09 19:31:29 -0800 | [diff] [blame] | 306 | r.shot_interpolation_table = InterpolationTable<Values::ShotParams>({ |
| 307 | {2, {0.08, 8.0}}, |
| 308 | {5, {0.6, 10.0}}, |
| 309 | }); |
| 310 | |
James Kuszmaul | b9ba9a5 | 2022-03-31 22:16:01 -0700 | [diff] [blame] | 311 | r.shot_velocity_interpolation_table = |
| 312 | InterpolationTable<Values::ShotVelocityParams>({ |
| 313 | {2, {2.0}}, |
| 314 | {5, {4.0}}, |
| 315 | }); |
| 316 | |
Siddhant Kanwar | 0e37f59 | 2022-02-21 19:26:50 -0800 | [diff] [blame] | 317 | climber->potentiometer_offset = 0.0; |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 318 | intake_front->potentiometer_offset = 0.0; |
| 319 | intake_front->subsystem_params.zeroing_constants |
| 320 | .measured_absolute_position = 0.0; |
| 321 | intake_back->potentiometer_offset = 0.0; |
| 322 | intake_back->subsystem_params.zeroing_constants |
| 323 | .measured_absolute_position = 0.0; |
| 324 | turret->potentiometer_offset = 0.0; |
| 325 | turret->subsystem_params.zeroing_constants.measured_absolute_position = |
| 326 | 0.0; |
Griffin Bui | bcbef48 | 2022-02-23 15:32:10 -0800 | [diff] [blame] | 327 | flipper_arm_left->potentiometer_offset = 0.0; |
| 328 | flipper_arm_right->potentiometer_offset = 0.0; |
Austin Schuh | 39f26f6 | 2022-02-24 21:34:46 -0800 | [diff] [blame] | 329 | |
| 330 | catapult_params->zeroing_constants.measured_absolute_position = 0.0; |
| 331 | catapult->potentiometer_offset = 0.0; |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 332 | break; |
| 333 | |
| 334 | default: |
| 335 | LOG(FATAL) << "unknown team: " << team; |
| 336 | } |
| 337 | |
| 338 | return r; |
| 339 | } |
| 340 | |
Henry Speiser | 55aa3ba | 2022-02-21 23:21:12 -0800 | [diff] [blame] | 341 | Values MakeValues() { return MakeValues(aos::network::GetTeamNumber()); } |
milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame] | 342 | |
| 343 | } // namespace constants |
| 344 | } // namespace y2022 |