Tyler Chatow | 6107aba | 2017-01-22 01:39:40 +0000 | [diff] [blame] | 1 | #ifndef Y2017_CONSTANTS_H_ |
| 2 | #define Y2017_CONSTANTS_H_ |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | |
| 6 | namespace y2017 { |
| 7 | namespace constants { |
| 8 | |
| 9 | // Has all of the numbers that change for both robots and makes it easy to |
| 10 | // retrieve the values for the current one. |
| 11 | |
| 12 | // Everything is in SI units (volts, radians, meters, seconds, etc). |
| 13 | // Some of these values are related to the conversion between raw values |
| 14 | // (encoder counts, voltage, etc) to scaled units (radians, meters, etc). |
| 15 | |
| 16 | // This structure contains current values for all of the things that change. |
| 17 | struct Values { |
| 18 | // ///// Mutual constants between robots. ///// |
| 19 | // TODO(constants): Update/check these with what we're using this year. |
| 20 | static const int kZeroingSampleSize = 200; |
| 21 | |
| 22 | // The ratio from the encoder shaft to the drivetrain wheels. |
Brian Silverman | e5798e1 | 2017-02-04 23:22:59 -0800 | [diff] [blame] | 23 | // TODO(constants): Fix this. |
Tyler Chatow | 6107aba | 2017-01-22 01:39:40 +0000 | [diff] [blame] | 24 | static constexpr double kDrivetrainEncoderRatio = |
| 25 | (18.0 / 36.0) /*output reduction*/ * (44.0 / 30.0) /*encoder gears*/; |
| 26 | |
| 27 | // ///// Dynamic constants. ///// |
Diana Vandenberg | 223703d | 2017-01-28 17:39:53 -0800 | [diff] [blame] | 28 | double down_error; |
Tyler Chatow | 6107aba | 2017-01-22 01:39:40 +0000 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | // Creates (once) a Values instance for ::aos::network::GetTeamNumber() and |
| 32 | // returns a reference to it. |
| 33 | const Values &GetValues(); |
| 34 | |
| 35 | // Creates Values instances for each team number it is called with and returns |
| 36 | // them. |
| 37 | const Values &GetValuesForTeam(uint16_t team_number); |
| 38 | |
| 39 | } // namespace constants |
| 40 | } // namespace y2017 |
| 41 | |
| 42 | #endif // Y2017_CONSTANTS_H_ |