blob: 8bf1367bdcfcdd30571edf83cd93ec8327a5f3c1 [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 Silvermanc8e21512013-11-03 15:53:11 -080012const uint16_t kCompTeamNumber = 8971;
Brian Silverman63783c42013-09-28 21:57:41 -070013const 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 {
Brian Silvermanc8e21512013-11-03 15:53:11 -080017 // The numbers to use for scaling raw voltages to 0-1.
Brian Silverman6eb51f12013-11-02 14:39:01 -070018 double high, low;
19
Brian Silvermanc8e21512013-11-03 15:53:11 -080020 // The numbers for when the dog is clear of each gear.
Brian Silverman6eb51f12013-11-02 14:39:01 -070021 double clear_high, clear_low;
22};
23
Brian Silverman431500a2013-10-28 19:50:15 -070024// This structure contains current values for all of the things that change.
25struct Values {
26 // Wrist hall effect positive and negative edges.
27 // How many radians from horizontal to the location of interest.
28 double wrist_hall_effect_start_angle;
29 double wrist_hall_effect_stop_angle;
Austin Schuhfa033692013-02-24 01:00:55 -080030
Brian Silverman431500a2013-10-28 19:50:15 -070031 // Upper and lower extreme limits of travel for the wrist.
32 // These are the soft stops for up and down.
33 double wrist_upper_limit;
34 double wrist_lower_limit;
Austin Schuhdd3bc412013-03-16 17:02:40 -070035
Brian Silverman431500a2013-10-28 19:50:15 -070036 // Physical limits. These are here for testing.
37 double wrist_upper_physical_limit;
38 double wrist_lower_physical_limit;
James Kuszmaul4a4622b2013-03-02 16:28:29 -080039
Brian Silverman431500a2013-10-28 19:50:15 -070040 // Zeroing speed.
41 // The speed to move the wrist at when zeroing in rad/sec
42 double wrist_zeroing_speed;
43 // Zeroing off speed (in rad/sec).
44 double wrist_zeroing_off_speed;
Austin Schuhfa033692013-02-24 01:00:55 -080045
Brian Silverman431500a2013-10-28 19:50:15 -070046 // AngleAdjust hall effect positive and negative edges.
47 // These are the soft stops for up and down.
48 const double (&angle_adjust_hall_effect_start_angle)[2];
49 const double (&angle_adjust_hall_effect_stop_angle)[2];
Brian Silverman3cb1d802013-08-30 15:41:49 -070050
Brian Silverman431500a2013-10-28 19:50:15 -070051 // Upper and lower extreme limits of travel for the angle adjust.
52 double angle_adjust_upper_limit;
53 double angle_adjust_lower_limit;
54 // Physical limits. These are here for testing.
55 double angle_adjust_upper_physical_limit;
56 double angle_adjust_lower_physical_limit;
Brian Silverman656789c2013-09-21 23:53:35 -070057
Brian Silverman431500a2013-10-28 19:50:15 -070058 // The speed to move the angle adjust when zeroing, in rad/sec
59 double angle_adjust_zeroing_speed;
60 // Zeroing off speed.
61 double angle_adjust_zeroing_off_speed;
62
63 // Deadband voltage.
64 double angle_adjust_deadband;
65
Brian Silverman1a6590d2013-11-04 14:46:46 -080066 // The ratio from the encoder shaft to the drivetrain wheels.
67 double drivetrain_encoder_ratio;
68
69 // The gear ratios from motor shafts to the drivetrain wheels for high and low
70 // gear.
71 double low_gear_ratio;
72 double high_gear_ratio;
Brian Silverman431500a2013-10-28 19:50:15 -070073
Brian Silverman6eb51f12013-11-02 14:39:01 -070074 ShifterHallEffect left_drive, right_drive;
75
Brian Silverman1a6590d2013-11-04 14:46:46 -080076 bool clutch_transmission;
77
Brian Silverman431500a2013-10-28 19:50:15 -070078 // How many pixels off center the vertical line
79 // on the camera view is.
80 int camera_center;
81};
82
83// Creates (once) a Values instance and returns a reference to it.
84const Values &GetValues();
brians343bc112013-02-10 01:53:46 +000085
86} // namespace constants
87} // namespace frc971
Brian Silverman431500a2013-10-28 19:50:15 -070088
89#endif // FRC971_CONSTANTS_H_