Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 1 | #ifndef FRC971_CONSTANTS_H_ |
| 2 | #define FRC971_CONSTANTS_H_ |
Brian Silverman | 2c590c3 | 2013-11-04 18:08:54 -0800 | [diff] [blame] | 3 | |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 4 | namespace frc971 { |
| 5 | namespace constants { |
| 6 | |
Brian Silverman | b691f5e | 2015-08-02 11:37:55 -0700 | [diff] [blame] | 7 | struct ZeroingConstants { |
| 8 | // The number of samples in the moving average filter. |
| 9 | int average_filter_size; |
| 10 | // The difference in scaled units between two index pulses. |
| 11 | double index_difference; |
| 12 | // The absolute position in scaled units of one of the index pulses. |
| 13 | double measured_index_position; |
| 14 | // Value between 0 and 1 which determines a fraction of the index_diff |
| 15 | // you want to use. |
| 16 | double allowable_encoder_error; |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 17 | }; |
| 18 | |
Tyler Chatow | 61f7797 | 2017-02-04 17:41:14 -0800 | [diff] [blame] | 19 | struct EncoderPlusIndexZeroingConstants { |
| 20 | // The amount of index pulses in the limb's range of motion. |
| 21 | int num_index_pulses; |
| 22 | }; |
| 23 | |
| 24 | struct PotAndAbsoluteEncoderZeroingConstants { |
| 25 | // The distance that the absolute encoder needs to complete a full rotation. |
| 26 | double abs_duration; |
| 27 | // Sample mechanism angle and absolute encoder value. |
| 28 | double sample_abs_value; |
| 29 | double sample_degrees; |
| 30 | }; |
| 31 | |
Brian Silverman | ebca77a | 2016-02-14 22:14:00 -0500 | [diff] [blame] | 32 | // Defines a range of motion for a subsystem. |
| 33 | // These are all absolute positions in scaled units. |
| 34 | struct Range { |
| 35 | double lower_hard; |
| 36 | double upper_hard; |
| 37 | double lower; |
| 38 | double upper; |
| 39 | }; |
| 40 | |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 41 | } // namespace constants |
| 42 | } // namespace frc971 |
Brian Silverman | 431500a | 2013-10-28 19:50:15 -0700 | [diff] [blame] | 43 | |
| 44 | #endif // FRC971_CONSTANTS_H_ |