blob: 3ca12c9ffebf74bb3cd983c4d5979102093535fb [file] [log] [blame]
Tyler Chatow6107aba2017-01-22 01:39:40 +00001#ifndef Y2017_CONSTANTS_H_
2#define Y2017_CONSTANTS_H_
3
4#include <stdint.h>
5
6namespace y2017 {
7namespace 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.
17struct 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;
Diana Vandenberg223703d2017-01-28 17:39:53 -080028
29 double down_error;
Tyler Chatow6107aba2017-01-22 01:39:40 +000030};
31
32// Creates (once) a Values instance for ::aos::network::GetTeamNumber() and
33// returns a reference to it.
34const Values &GetValues();
35
36// Creates Values instances for each team number it is called with and returns
37// them.
38const Values &GetValuesForTeam(uint16_t team_number);
39
40} // namespace constants
41} // namespace y2017
42
43#endif // Y2017_CONSTANTS_H_