blob: 1017dcdc55ea19135a6c50bfbb32c860fe5460c9 [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.
Brian Silvermane5798e12017-02-04 23:22:59 -080023 // TODO(constants): Fix this.
Tyler Chatow6107aba2017-01-22 01:39:40 +000024 static constexpr double kDrivetrainEncoderRatio =
25 (18.0 / 36.0) /*output reduction*/ * (44.0 / 30.0) /*encoder gears*/;
26
27 // ///// Dynamic constants. /////
Diana Vandenberg223703d2017-01-28 17:39:53 -080028 double down_error;
Tyler Chatow6107aba2017-01-22 01:39:40 +000029};
30
31// Creates (once) a Values instance for ::aos::network::GetTeamNumber() and
32// returns a reference to it.
33const Values &GetValues();
34
35// Creates Values instances for each team number it is called with and returns
36// them.
37const Values &GetValuesForTeam(uint16_t team_number);
38
39} // namespace constants
40} // namespace y2017
41
42#endif // Y2017_CONSTANTS_H_