Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 1 | #include "frc971/constants.h" |
| 2 | |
| 3 | #include <math.h> |
| 4 | #include <stdint.h> |
| 5 | #include <inttypes.h> |
| 6 | |
Brian Silverman | 0a151c9 | 2014-05-02 15:28:44 -0700 | [diff] [blame] | 7 | #include <map> |
| 8 | |
| 9 | #if __has_feature(address_sanitizer) |
| 10 | #include "sanitizer/lsan_interface.h" |
| 11 | #endif |
| 12 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 13 | #include "aos/common/logging/logging.h" |
| 14 | #include "aos/common/once.h" |
| 15 | #include "aos/common/network/team_number.h" |
Brian Silverman | 0a151c9 | 2014-05-02 15:28:44 -0700 | [diff] [blame] | 16 | #include "aos/common/mutex.h" |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 17 | |
Brian Silverman | 2c590c3 | 2013-11-04 18:08:54 -0800 | [diff] [blame] | 18 | #include "frc971/control_loops/drivetrain/polydrivetrain_dog_motor_plant.h" |
Brian Silverman | 2c590c3 | 2013-11-04 18:08:54 -0800 | [diff] [blame] | 19 | #include "frc971/control_loops/drivetrain/drivetrain_dog_motor_plant.h" |
Brian Silverman | 2c590c3 | 2013-11-04 18:08:54 -0800 | [diff] [blame] | 20 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 21 | #ifndef M_PI |
| 22 | #define M_PI 3.14159265358979323846 |
| 23 | #endif |
| 24 | |
| 25 | namespace frc971 { |
| 26 | namespace constants { |
| 27 | namespace { |
| 28 | |
Brian Silverman | e5db0c6 | 2014-03-13 15:53:18 -0700 | [diff] [blame] | 29 | const uint16_t kCompTeamNumber = 971; |
Brian Silverman | a20703b | 2014-03-20 14:29:37 -0700 | [diff] [blame] | 30 | const uint16_t kPracticeTeamNumber = 9971; |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 31 | |
| 32 | // ///// Drivetrain Constants |
Brian Silverman | e5db0c6 | 2014-03-13 15:53:18 -0700 | [diff] [blame] | 33 | |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 34 | // These three constants were set by Daniel on 2/13/15. |
| 35 | const double kDrivetrainEncoderRatio = 20.0 / 64.0; |
| 36 | const double kLowGearRatio = kDrivetrainEncoderRatio * 20.0 / 50.0; |
| 37 | const double kHighGearRatio = kLowGearRatio; |
Brian Silverman | 1a6590d | 2013-11-04 14:46:46 -0800 | [diff] [blame] | 38 | |
Brian Silverman | e5db0c6 | 2014-03-13 15:53:18 -0700 | [diff] [blame] | 39 | const ShifterHallEffect kCompRightDriveShifter{555, 657, 660, 560, 0.2, 0.7}; |
| 40 | const ShifterHallEffect kCompLeftDriveShifter{555, 660, 644, 552, 0.2, 0.7}; |
Brian Silverman | 6eb51f1 | 2013-11-02 14:39:01 -0700 | [diff] [blame] | 41 | |
Austin Schuh | 010eb81 | 2014-10-25 18:06:49 -0700 | [diff] [blame] | 42 | const ShifterHallEffect kPracticeRightDriveShifter{2.95, 3.95, 3.95, 2.95, 0.2, 0.7}; |
| 43 | const ShifterHallEffect kPracticeLeftDriveShifter{2.95, 4.2, 3.95, 3.0, 0.2, 0.7}; |
Brian Silverman | e5db0c6 | 2014-03-13 15:53:18 -0700 | [diff] [blame] | 44 | |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 45 | // Set by Daniel on 2/13/15. |
| 46 | // Distance from the center of the left wheel to the center of the right wheel. |
| 47 | const double kRobotWidth = 37.806 /*inches*/ * 0.0254; |
Brian Silverman | 6eb51f1 | 2013-11-02 14:39:01 -0700 | [diff] [blame] | 48 | |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 49 | // ///// Superstructure Constants |
| 50 | |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 51 | // Elevator gearbox pulley output constants. |
| 52 | const int kElevatorGearboxOutputPulleyTeeth = 32; // 32 teeth |
| 53 | const double kElevatorGearboxOutputPitch = 0.005; // 5 mm/tooth |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 54 | const double kElevatorGearboxOutputRadianDistance = |
| 55 | kElevatorGearboxOutputPulleyTeeth * kElevatorGearboxOutputPitch / |
| 56 | (2.0 * M_PI); |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 57 | |
Austin Schuh | 703b8d4 | 2015-02-01 14:56:34 -0800 | [diff] [blame] | 58 | const double kMaxAllowedLeftRightArmDifference = 0.01; // radians |
| 59 | const double kMaxAllowedLeftRightElevatorDifference = 0.01; // meters |
| 60 | |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 61 | // Gearing ratios of the pots and encoders for the elevator and arm. |
| 62 | // Ratio is output shaft rotations per encoder/pot rotation |
| 63 | // Checked by Daniel on 2/13/15. |
| 64 | const double kArmEncoderRatio = 18.0 / 48.0 * 16.0 / 72.0; |
| 65 | const double kArmPotRatio = 48.0 / 48.0 * 16.0 / 72.0; |
| 66 | const double kElevatorEncoderRatio = 14.0 / 84.0; |
| 67 | const double kElevatorPotRatio = 1.0; |
| 68 | const double kClawEncoderRatio = 18.0 / 72.0; |
| 69 | const double kClawPotRatio = 18.0 / 72.0; |
| 70 | |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 71 | // Number of radians between each index pulse on the arm. |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 72 | const double kArmEncoderIndexDifference = 2.0 * M_PI * kArmEncoderRatio; |
| 73 | // Number of meters between each index pulse on the elevator. |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 74 | const double kElevatorEncoderIndexDifference = |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 75 | kElevatorEncoderRatio * |
| 76 | 2.0 * M_PI * // radians |
| 77 | kElevatorGearboxOutputRadianDistance; |
| 78 | // Number of radians between index pulses on the claw. |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 79 | const double kClawEncoderIndexDifference = 2.0 * M_PI * kClawEncoderRatio; |
| 80 | |
| 81 | const int kZeroingSampleSize = 20; |
Brian Silverman | edcfd2d | 2014-04-03 13:04:16 -0700 | [diff] [blame] | 82 | |
Ben Fredrickson | a9dcfa4 | 2014-02-23 02:05:59 +0000 | [diff] [blame] | 83 | const Values *DoGetValuesForTeam(uint16_t team) { |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 84 | switch (team) { |
Brian Silverman | 0d2b7cb | 2014-02-18 20:25:57 -0800 | [diff] [blame] | 85 | case 1: // for tests |
| 86 | return new Values{ |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 87 | kDrivetrainEncoderRatio, |
| 88 | kArmEncoderRatio, |
| 89 | kArmPotRatio, |
| 90 | kElevatorEncoderRatio, |
| 91 | kElevatorPotRatio, |
| 92 | kElevatorGearboxOutputRadianDistance, |
| 93 | kClawEncoderRatio, |
| 94 | kClawPotRatio, |
| 95 | kLowGearRatio, |
| 96 | kHighGearRatio, |
Brian Silverman | 0d2b7cb | 2014-02-18 20:25:57 -0800 | [diff] [blame] | 97 | kCompLeftDriveShifter, |
| 98 | kCompRightDriveShifter, |
Austin Schuh | 1172621 | 2014-03-02 14:01:02 -0800 | [diff] [blame] | 99 | false, |
Brian Silverman | ad9e000 | 2014-04-13 14:55:57 -0700 | [diff] [blame] | 100 | 0.5, |
Austin Schuh | a25a041 | 2014-03-09 00:50:04 -0800 | [diff] [blame] | 101 | control_loops::MakeVelocityDrivetrainLoop, |
| 102 | control_loops::MakeDrivetrainLoop, |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 103 | 0.02, // drivetrain done delta |
| 104 | 5.0, // drivetrain max speed |
| 105 | |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 106 | // Motion ranges: hard_lower_limit, hard_upper_limit, |
| 107 | // soft_lower_limit, soft_upper_limit |
| 108 | // TODO(sensors): Get actual bounds before turning on robot. |
| 109 | { |
| 110 | // Claw values, in radians. |
| 111 | // 0 is level with the ground. |
| 112 | // Positive moves in the direction of positive encoder values. |
| 113 | {0.0000000000, 1.5700000000, |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 114 | 0.1000000000, 1.2000000000}, |
| 115 | |
| 116 | // Zeroing constants for wrist. |
| 117 | // TODO(sensors): Get actual offsets for these. |
| 118 | {kZeroingSampleSize, kClawEncoderIndexDifference, 0.0}, |
James Kuszmaul | 9ead1de | 2014-02-28 21:24:39 -0800 | [diff] [blame] | 119 | }, |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 120 | |
| 121 | { |
| 122 | // Elevator values, in meters. |
Austin Schuh | 703b8d4 | 2015-02-01 14:56:34 -0800 | [diff] [blame] | 123 | // TODO(austin): Fix this. Positive is up. |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 124 | // 0 is at the top of the elevator frame. |
| 125 | // Positive is down towards the drivebase. |
| 126 | {0.0000000000, 0.6790000000, |
| 127 | 0.2000000000, 0.6000000000}, |
| 128 | |
| 129 | // Arm values, in radians. |
| 130 | // 0 is sticking straight out horizontally over the intake/front. |
| 131 | // Positive is rotating up and into the robot (towards the back). |
Austin Schuh | 703b8d4 | 2015-02-01 14:56:34 -0800 | [diff] [blame] | 132 | {-1.570000000, 1.5700000000, |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 133 | -1.200000000, 1.2000000000}, |
| 134 | |
| 135 | // Elevator zeroing constants: left, right. |
| 136 | // TODO(sensors): Get actual offsets for these. |
| 137 | {kZeroingSampleSize, kElevatorEncoderIndexDifference, 0.0}, |
| 138 | {kZeroingSampleSize, kElevatorEncoderIndexDifference, 0.0}, |
| 139 | // Arm zeroing constants: left, right. |
| 140 | {kZeroingSampleSize, kArmEncoderIndexDifference, 0.0}, |
| 141 | {kZeroingSampleSize, kArmEncoderIndexDifference, 0.0}, |
Austin Schuh | 703b8d4 | 2015-02-01 14:56:34 -0800 | [diff] [blame] | 142 | }, |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 143 | // End "sensor" values. |
Austin Schuh | 703b8d4 | 2015-02-01 14:56:34 -0800 | [diff] [blame] | 144 | |
| 145 | kMaxAllowedLeftRightArmDifference, |
| 146 | kMaxAllowedLeftRightElevatorDifference, |
Brian Silverman | 0d2b7cb | 2014-02-18 20:25:57 -0800 | [diff] [blame] | 147 | }; |
| 148 | break; |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 149 | case kCompTeamNumber: |
Brian Silverman | 756f9ff | 2014-01-17 23:40:23 -0800 | [diff] [blame] | 150 | return new Values{ |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 151 | kDrivetrainEncoderRatio, |
| 152 | kArmEncoderRatio, |
| 153 | kArmPotRatio, |
| 154 | kElevatorEncoderRatio, |
| 155 | kElevatorPotRatio, |
| 156 | kElevatorGearboxOutputRadianDistance, |
| 157 | kClawEncoderRatio, |
| 158 | kClawPotRatio, |
| 159 | kLowGearRatio, |
| 160 | kHighGearRatio, |
Austin Schuh | 288c8c3 | 2014-02-16 17:20:17 -0800 | [diff] [blame] | 161 | kCompLeftDriveShifter, |
| 162 | kCompRightDriveShifter, |
Brian Silverman | edcfd2d | 2014-04-03 13:04:16 -0700 | [diff] [blame] | 163 | false, |
Brian Silverman | ad9e000 | 2014-04-13 14:55:57 -0700 | [diff] [blame] | 164 | kRobotWidth, |
Austin Schuh | a25a041 | 2014-03-09 00:50:04 -0800 | [diff] [blame] | 165 | control_loops::MakeVelocityDrivetrainLoop, |
| 166 | control_loops::MakeDrivetrainLoop, |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 167 | 0.02, // drivetrain done delta |
| 168 | 5.0, // drivetrain max speed |
| 169 | |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 170 | // Motion ranges: hard_lower_limit, hard_upper_limit, |
| 171 | // soft_lower_limit, soft_upper_limit |
| 172 | // TODO(sensors): Get actual bounds before turning on robot. |
| 173 | { |
| 174 | // Claw values, in radians. |
| 175 | // 0 is level with the ground. |
| 176 | // Positive moves in the direction of positive encoder values. |
| 177 | {0.0000000000, 1.5700000000, |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 178 | 0.1000000000, 1.2000000000}, |
| 179 | |
| 180 | // Zeroing constants for wrist. |
| 181 | // TODO(sensors): Get actual offsets for these. |
| 182 | {kZeroingSampleSize, kClawEncoderIndexDifference, 0.0}, |
| 183 | |
James Kuszmaul | 9ead1de | 2014-02-28 21:24:39 -0800 | [diff] [blame] | 184 | }, |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 185 | |
| 186 | { |
| 187 | // Elevator values, in meters. |
| 188 | // 0 is at the top of the elevator frame. |
| 189 | // Positive is down towards the drivebase. |
| 190 | {0.0000000000, 0.6790000000, |
| 191 | 0.2000000000, 0.6000000000}, |
| 192 | |
| 193 | // Arm values, in radians. |
| 194 | // 0 is sticking straight out horizontally over the intake/front. |
| 195 | // Positive is rotating up and into the robot (towards the back). |
Austin Schuh | 703b8d4 | 2015-02-01 14:56:34 -0800 | [diff] [blame] | 196 | {-1.570000000, 1.5700000000, |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 197 | -1.200000000, 1.2000000000}, |
| 198 | |
| 199 | // Elevator zeroing constants: left, right. |
| 200 | // TODO(sensors): Get actual offsets for these. |
| 201 | {kZeroingSampleSize, kElevatorEncoderIndexDifference, 0.0}, |
| 202 | {kZeroingSampleSize, kElevatorEncoderIndexDifference, 0.0}, |
| 203 | // Arm zeroing constants: left, right. |
| 204 | {kZeroingSampleSize, kArmEncoderIndexDifference, 0.0}, |
| 205 | {kZeroingSampleSize, kArmEncoderIndexDifference, 0.0}, |
Austin Schuh | 703b8d4 | 2015-02-01 14:56:34 -0800 | [diff] [blame] | 206 | }, |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 207 | // End "sensor" values. |
Austin Schuh | 703b8d4 | 2015-02-01 14:56:34 -0800 | [diff] [blame] | 208 | |
| 209 | kMaxAllowedLeftRightArmDifference, |
| 210 | kMaxAllowedLeftRightElevatorDifference, |
Brian Silverman | 756f9ff | 2014-01-17 23:40:23 -0800 | [diff] [blame] | 211 | }; |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 212 | break; |
| 213 | case kPracticeTeamNumber: |
Brian Silverman | 756f9ff | 2014-01-17 23:40:23 -0800 | [diff] [blame] | 214 | return new Values{ |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 215 | kDrivetrainEncoderRatio, |
| 216 | kArmEncoderRatio, |
| 217 | kArmPotRatio, |
| 218 | kElevatorEncoderRatio, |
| 219 | kElevatorPotRatio, |
| 220 | kElevatorGearboxOutputRadianDistance, |
| 221 | kClawEncoderRatio, |
| 222 | kClawPotRatio, |
| 223 | kLowGearRatio, |
| 224 | kHighGearRatio, |
Austin Schuh | 288c8c3 | 2014-02-16 17:20:17 -0800 | [diff] [blame] | 225 | kPracticeLeftDriveShifter, |
| 226 | kPracticeRightDriveShifter, |
| 227 | false, |
Brian Silverman | ad9e000 | 2014-04-13 14:55:57 -0700 | [diff] [blame] | 228 | kRobotWidth, |
Austin Schuh | a25a041 | 2014-03-09 00:50:04 -0800 | [diff] [blame] | 229 | control_loops::MakeVelocityDrivetrainLoop, |
| 230 | control_loops::MakeDrivetrainLoop, |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 231 | 0.02, // drivetrain done delta |
| 232 | 5.0, // drivetrain max speed |
| 233 | |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 234 | // Motion ranges: hard_lower_limit, hard_upper_limit, |
| 235 | // soft_lower_limit, soft_upper_limit |
| 236 | // TODO(sensors): Get actual bounds before turning on robot. |
| 237 | { |
| 238 | // Claw values, in radians. |
| 239 | // 0 is level with the ground. |
| 240 | // Positive moves in the direction of positive encoder values. |
| 241 | {0.0000000000, 1.5700000000, |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 242 | 0.1000000000, 1.2000000000}, |
| 243 | |
| 244 | // Zeroing constants for wrist. |
| 245 | // TODO(sensors): Get actual offsets for these. |
| 246 | {kZeroingSampleSize, kClawEncoderIndexDifference, 0.0}, |
James Kuszmaul | 9ead1de | 2014-02-28 21:24:39 -0800 | [diff] [blame] | 247 | }, |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 248 | |
| 249 | { |
| 250 | // Elevator values, in meters. |
| 251 | // 0 is at the top of the elevator frame. |
| 252 | // Positive is down towards the drivebase. |
| 253 | {0.0000000000, 0.6790000000, |
| 254 | 0.2000000000, 0.6000000000}, |
| 255 | |
| 256 | // Arm values, in radians. |
| 257 | // 0 is sticking straight out horizontally over the intake/front. |
| 258 | // Positive is rotating up and into the robot (towards the back). |
Austin Schuh | 703b8d4 | 2015-02-01 14:56:34 -0800 | [diff] [blame] | 259 | {-1.570000000, 1.5700000000, |
Daniel Petti | a782741 | 2015-02-13 20:55:57 -0800 | [diff] [blame^] | 260 | -1.200000000, 1.2000000000}, |
| 261 | |
| 262 | // Elevator zeroing constants: left, right. |
| 263 | // TODO(sensors): Get actual offsets for these. |
| 264 | {kZeroingSampleSize, kElevatorEncoderIndexDifference, 0.0}, |
| 265 | {kZeroingSampleSize, kElevatorEncoderIndexDifference, 0.0}, |
| 266 | // Arm zeroing constants: left, right. |
| 267 | {kZeroingSampleSize, kArmEncoderIndexDifference, 0.0}, |
| 268 | {kZeroingSampleSize, kArmEncoderIndexDifference, 0.0}, |
Austin Schuh | 703b8d4 | 2015-02-01 14:56:34 -0800 | [diff] [blame] | 269 | }, |
Comran Morshed | 79bd3db | 2015-02-07 14:51:13 +0000 | [diff] [blame] | 270 | // TODO(sensors): End "sensor" values. |
Austin Schuh | 703b8d4 | 2015-02-01 14:56:34 -0800 | [diff] [blame] | 271 | |
| 272 | kMaxAllowedLeftRightArmDifference, |
| 273 | kMaxAllowedLeftRightElevatorDifference, |
Brian Silverman | 756f9ff | 2014-01-17 23:40:23 -0800 | [diff] [blame] | 274 | }; |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 275 | break; |
| 276 | default: |
| 277 | LOG(FATAL, "unknown team #%" PRIu16 "\n", team); |
| 278 | } |
| 279 | } |
| 280 | |
Ben Fredrickson | a9dcfa4 | 2014-02-23 02:05:59 +0000 | [diff] [blame] | 281 | const Values *DoGetValues() { |
| 282 | uint16_t team = ::aos::network::GetTeamNumber(); |
| 283 | LOG(INFO, "creating a Constants for team %" PRIu16 "\n", team); |
| 284 | return DoGetValuesForTeam(team); |
| 285 | } |
| 286 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 287 | } // namespace |
| 288 | |
| 289 | const Values &GetValues() { |
| 290 | static ::aos::Once<const Values> once(DoGetValues); |
| 291 | return *once.Get(); |
| 292 | } |
| 293 | |
Ben Fredrickson | a9dcfa4 | 2014-02-23 02:05:59 +0000 | [diff] [blame] | 294 | const Values &GetValuesForTeam(uint16_t team_number) { |
Brian Silverman | 0a151c9 | 2014-05-02 15:28:44 -0700 | [diff] [blame] | 295 | static ::aos::Mutex mutex; |
| 296 | ::aos::MutexLocker locker(&mutex); |
| 297 | |
| 298 | // IMPORTANT: This declaration has to stay after the mutex is locked to avoid |
| 299 | // race conditions. |
| 300 | static ::std::map<uint16_t, const Values *> values; |
| 301 | |
| 302 | if (values.count(team_number) == 0) { |
| 303 | values[team_number] = DoGetValuesForTeam(team_number); |
| 304 | #if __has_feature(address_sanitizer) |
| 305 | __lsan_ignore_object(values[team_number]); |
| 306 | #endif |
| 307 | } |
| 308 | return *values[team_number]; |
Ben Fredrickson | a9dcfa4 | 2014-02-23 02:05:59 +0000 | [diff] [blame] | 309 | } |
| 310 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 311 | } // namespace constants |
| 312 | } // namespace frc971 |