blob: d91e1970326bb88beb3bd702b1fff9fb87830e71 [file] [log] [blame]
Brian Silverman431500a2013-10-28 19:50:15 -07001#ifndef FRC971_CONSTANTS_H_
2#define FRC971_CONSTANTS_H_
Brian Silverman2c590c32013-11-04 18:08:54 -08003
Austin Schuh5f01f152017-02-11 21:34:08 -08004#include <cstddef>
5
brians343bc112013-02-10 01:53:46 +00006namespace frc971 {
7namespace constants {
8
Tyler Chatowf8f03112017-02-05 14:31:34 -08009struct PotAndIndexPulseZeroingConstants {
Brian Silvermanb691f5e2015-08-02 11:37:55 -070010 // The number of samples in the moving average filter.
Austin Schuh5f01f152017-02-11 21:34:08 -080011 size_t average_filter_size;
Brian Silvermanb691f5e2015-08-02 11:37:55 -070012 // The difference in scaled units between two index pulses.
13 double index_difference;
14 // The absolute position in scaled units of one of the index pulses.
15 double measured_index_position;
16 // Value between 0 and 1 which determines a fraction of the index_diff
17 // you want to use.
18 double allowable_encoder_error;
Brian Silverman431500a2013-10-28 19:50:15 -070019};
20
Tyler Chatow61f77972017-02-04 17:41:14 -080021struct EncoderPlusIndexZeroingConstants {
22 // The amount of index pulses in the limb's range of motion.
23 int num_index_pulses;
24};
25
26struct PotAndAbsoluteEncoderZeroingConstants {
Austin Schuh5f01f152017-02-11 21:34:08 -080027 // The number of samples in the moving average filter.
28 size_t average_filter_size;
Tyler Chatow61f77972017-02-04 17:41:14 -080029 // The distance that the absolute encoder needs to complete a full rotation.
Austin Schuh5f01f152017-02-11 21:34:08 -080030 double one_revolution_distance;
31 // Measured absolute position of the encoder when at zero.
32 double measured_absolute_position;
33
34 // Treshold for deciding if we are moving
35 // TODO(austin): Figure out what this is actually measuring.
36 double zeroing_threshold;
Diana Vandenberg8fea6ea2017-02-18 17:24:45 -080037
38 // Buffer size for deciding if we are moving.
39 size_t moving_buffer_size;
Tyler Chatow61f77972017-02-04 17:41:14 -080040};
41
Brian Silvermanebca77a2016-02-14 22:14:00 -050042// Defines a range of motion for a subsystem.
43// These are all absolute positions in scaled units.
44struct Range {
45 double lower_hard;
46 double upper_hard;
47 double lower;
48 double upper;
49};
50
brians343bc112013-02-10 01:53:46 +000051} // namespace constants
52} // namespace frc971
Brian Silverman431500a2013-10-28 19:50:15 -070053
54#endif // FRC971_CONSTANTS_H_