blob: 03929a2d3d249be36ba91d989625f486f446d216 [file] [log] [blame]
Brian Silvermane0a95462014-02-17 00:41:09 -08001package frc971;
2
Brian Silverman0a7f6062015-01-24 17:41:33 -05003// Represents all of the data for a single potentiometer and indexed encoder
4// pair.
5// The units on all of the positions are the same.
6// All encoder values are relative to where the encoder was at some arbitrary
7// point in time. All potentiometer values are relative to some arbitrary 0
8// position which varies with each robot.
9struct PotAndIndexPosition {
10 // Current position read from the encoder.
11 double encoder;
12 // Current position read from the potentiometer.
13 double pot;
14
15 // Position from the encoder latched at the last index pulse.
16 double latched_encoder;
17 // Position from the potentiometer latched at the last index pulse.
18 double latched_pot;
19
20 // How many index pulses we've seen since startup. Starts at 0.
21 uint32_t index_pulses;
Brian Silvermane0a95462014-02-17 00:41:09 -080022};
Brian Silverman5b433df2014-02-17 11:57:37 -080023
Brian Silverman0a7f6062015-01-24 17:41:33 -050024// A left/right pair of PotAndIndexPositions.
25struct PotAndIndexPair {
26 PotAndIndexPosition left;
27 PotAndIndexPosition right;
Austin Schuh60c56662014-02-17 14:37:19 -080028};