Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 1 | #ifndef FRC971_CONSTANTS_H_ |
| 2 | #define FRC971_CONSTANTS_H_ |
| 3 | |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 4 | #include <stdint.h> |
| 5 | |
| 6 | namespace frc971 { |
| 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. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 11 | |
Brian Silverman | c8e2151 | 2013-11-03 15:53:11 -0800 | [diff] [blame] | 12 | const uint16_t kCompTeamNumber = 8971; |
Brian Silverman | 63783c4 | 2013-09-28 21:57:41 -0700 | [diff] [blame] | 13 | const uint16_t kPracticeTeamNumber = 971; |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 14 | |
Brian Silverman | 6eb51f1 | 2013-11-02 14:39:01 -0700 | [diff] [blame] | 15 | // Contains the voltages for an analog hall effect sensor on a shifter. |
| 16 | struct ShifterHallEffect { |
Brian Silverman | c8e2151 | 2013-11-03 15:53:11 -0800 | [diff] [blame] | 17 | // The numbers to use for scaling raw voltages to 0-1. |
Brian Silverman | 6eb51f1 | 2013-11-02 14:39:01 -0700 | [diff] [blame] | 18 | double high, low; |
| 19 | |
Brian Silverman | c8e2151 | 2013-11-03 15:53:11 -0800 | [diff] [blame] | 20 | // The numbers for when the dog is clear of each gear. |
Brian Silverman | 6eb51f1 | 2013-11-02 14:39:01 -0700 | [diff] [blame] | 21 | double clear_high, clear_low; |
| 22 | }; |
| 23 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 24 | // This structure contains current values for all of the things that change. |
| 25 | struct 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 Schuh | fa03369 | 2013-02-24 01:00:55 -0800 | [diff] [blame] | 30 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 31 | // 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 Schuh | dd3bc41 | 2013-03-16 17:02:40 -0700 | [diff] [blame] | 35 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 36 | // Physical limits. These are here for testing. |
| 37 | double wrist_upper_physical_limit; |
| 38 | double wrist_lower_physical_limit; |
James Kuszmaul | 4a4622b | 2013-03-02 16:28:29 -0800 | [diff] [blame] | 39 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 40 | // 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 Schuh | fa03369 | 2013-02-24 01:00:55 -0800 | [diff] [blame] | 45 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 46 | // 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 Silverman | 3cb1d80 | 2013-08-30 15:41:49 -0700 | [diff] [blame] | 50 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 51 | // 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 Silverman | 656789c | 2013-09-21 23:53:35 -0700 | [diff] [blame] | 57 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 58 | // 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 Silverman | 1a6590d | 2013-11-04 14:46:46 -0800 | [diff] [blame^] | 66 | // 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 Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 73 | |
Brian Silverman | 6eb51f1 | 2013-11-02 14:39:01 -0700 | [diff] [blame] | 74 | ShifterHallEffect left_drive, right_drive; |
| 75 | |
Brian Silverman | 1a6590d | 2013-11-04 14:46:46 -0800 | [diff] [blame^] | 76 | bool clutch_transmission; |
| 77 | |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 78 | // 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. |
| 84 | const Values &GetValues(); |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 85 | |
| 86 | } // namespace constants |
| 87 | } // namespace frc971 |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 88 | |
| 89 | #endif // FRC971_CONSTANTS_H_ |