blob: da748d989a9143853a5375dac4d1298030e70ead [file] [log] [blame]
Brian Silverman431500a2013-10-28 19:50:15 -07001#ifndef FRC971_CONSTANTS_H_
2#define FRC971_CONSTANTS_H_
3
brians343bc112013-02-10 01:53:46 +00004#include <stdint.h>
5
6namespace frc971 {
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.
brians343bc112013-02-10 01:53:46 +000011
Brian Silverman63783c42013-09-28 21:57:41 -070012const uint16_t kCompTeamNumber = 5971;
13const uint16_t kPracticeTeamNumber = 971;
brians343bc112013-02-10 01:53:46 +000014
Brian Silverman6eb51f12013-11-02 14:39:01 -070015// Contains the voltages for an analog hall effect sensor on a shifter.
16struct ShifterHallEffect {
17 double high, low;
18
19 double clear_high, clear_low;
20};
21
Brian Silverman431500a2013-10-28 19:50:15 -070022// This structure contains current values for all of the things that change.
23struct Values {
24 // Wrist hall effect positive and negative edges.
25 // How many radians from horizontal to the location of interest.
26 double wrist_hall_effect_start_angle;
27 double wrist_hall_effect_stop_angle;
Austin Schuhfa033692013-02-24 01:00:55 -080028
Brian Silverman431500a2013-10-28 19:50:15 -070029 // Upper and lower extreme limits of travel for the wrist.
30 // These are the soft stops for up and down.
31 double wrist_upper_limit;
32 double wrist_lower_limit;
Austin Schuhdd3bc412013-03-16 17:02:40 -070033
Brian Silverman431500a2013-10-28 19:50:15 -070034 // Physical limits. These are here for testing.
35 double wrist_upper_physical_limit;
36 double wrist_lower_physical_limit;
James Kuszmaul4a4622b2013-03-02 16:28:29 -080037
Brian Silverman431500a2013-10-28 19:50:15 -070038 // Zeroing speed.
39 // The speed to move the wrist at when zeroing in rad/sec
40 double wrist_zeroing_speed;
41 // Zeroing off speed (in rad/sec).
42 double wrist_zeroing_off_speed;
Austin Schuhfa033692013-02-24 01:00:55 -080043
Brian Silverman431500a2013-10-28 19:50:15 -070044 // AngleAdjust hall effect positive and negative edges.
45 // These are the soft stops for up and down.
46 const double (&angle_adjust_hall_effect_start_angle)[2];
47 const double (&angle_adjust_hall_effect_stop_angle)[2];
Brian Silverman3cb1d802013-08-30 15:41:49 -070048
Brian Silverman431500a2013-10-28 19:50:15 -070049 // Upper and lower extreme limits of travel for the angle adjust.
50 double angle_adjust_upper_limit;
51 double angle_adjust_lower_limit;
52 // Physical limits. These are here for testing.
53 double angle_adjust_upper_physical_limit;
54 double angle_adjust_lower_physical_limit;
Brian Silverman656789c2013-09-21 23:53:35 -070055
Brian Silverman431500a2013-10-28 19:50:15 -070056 // The speed to move the angle adjust when zeroing, in rad/sec
57 double angle_adjust_zeroing_speed;
58 // Zeroing off speed.
59 double angle_adjust_zeroing_off_speed;
60
61 // Deadband voltage.
62 double angle_adjust_deadband;
63
64 // The number of teeth on the pinion that drives the drivetrain wheels.
65 int drivetrain_gearbox_pinion;
66
Brian Silverman6eb51f12013-11-02 14:39:01 -070067 ShifterHallEffect left_drive, right_drive;
68
Brian Silverman431500a2013-10-28 19:50:15 -070069 // How many pixels off center the vertical line
70 // on the camera view is.
71 int camera_center;
72};
73
74// Creates (once) a Values instance and returns a reference to it.
75const Values &GetValues();
brians343bc112013-02-10 01:53:46 +000076
77} // namespace constants
78} // namespace frc971
Brian Silverman431500a2013-10-28 19:50:15 -070079
80#endif // FRC971_CONSTANTS_H_