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. |
| 23 | static constexpr double kDrivetrainEncoderRatio = |
| 24 | (18.0 / 36.0) /*output reduction*/ * (44.0 / 30.0) /*encoder gears*/; |
| 25 | |
| 26 | // ///// Dynamic constants. ///// |
| 27 | double drivetrain_max_speed; |
| 28 | }; |
| 29 | |
| 30 | // Creates (once) a Values instance for ::aos::network::GetTeamNumber() and |
| 31 | // returns a reference to it. |
| 32 | const Values &GetValues(); |
| 33 | |
| 34 | // Creates Values instances for each team number it is called with and returns |
| 35 | // them. |
| 36 | const Values &GetValuesForTeam(uint16_t team_number); |
| 37 | |
| 38 | } // namespace constants |
| 39 | } // namespace y2017 |
| 40 | |
| 41 | #endif // Y2017_CONSTANTS_H_ |