Brian Silverman | 68a5a01 | 2013-03-29 23:37:04 -0700 | [diff] [blame] | 1 | #ifndef VISION_SENSOR_PROCESSOR_H_ |
| 2 | #define VISION_SENSOR_PROCESSOR_H_ |
Brian Silverman | 6ae77dd | 2013-03-29 22:28:08 -0700 | [diff] [blame] | 3 | |
Brian Silverman | 68a5a01 | 2013-03-29 23:37:04 -0700 | [diff] [blame] | 4 | namespace frc971 { |
Brian Silverman | 6ae77dd | 2013-03-29 22:28:08 -0700 | [diff] [blame] | 5 | |
| 6 | // struct maps a single point x to to a value f of x |
| 7 | typedef struct { |
| 8 | double x; |
| 9 | double fx; |
| 10 | } Interpolation; |
| 11 | |
Brian Silverman | 68a5a01 | 2013-03-29 23:37:04 -0700 | [diff] [blame] | 12 | static const Interpolation kPixelsToMeters[] = { |
| 13 | {43.0 / 320.0, 12.573}, |
| 14 | {98.0 / 320.0, 6.604}, |
| 15 | {145.75 / 320.0, 4.420}, |
| 16 | {216.75 / 320.0, 2.794}, |
| 17 | }; |
| 18 | |
| 19 | static const Interpolation kMetersToShooterSpeeds[] = { |
| 20 | {10.0, 200.0}, |
| 21 | {5.0, 175.0}, |
| 22 | }; |
| 23 | |
| 24 | static const Interpolation kMetersToShooterAngles[] = { |
| 25 | {10.0, 0.7}, |
| 26 | {5.0, 0.9}, |
| 27 | }; |
Brian Silverman | 6ae77dd | 2013-03-29 22:28:08 -0700 | [diff] [blame] | 28 | |
| 29 | double interpolate(int num_interp_vals, |
| 30 | const Interpolation *interp, double value); |
| 31 | |
Brian Silverman | 68a5a01 | 2013-03-29 23:37:04 -0700 | [diff] [blame] | 32 | } // namespace frc971 |
Brian Silverman | 6ae77dd | 2013-03-29 22:28:08 -0700 | [diff] [blame] | 33 | |
Brian Silverman | 68a5a01 | 2013-03-29 23:37:04 -0700 | [diff] [blame] | 34 | #endif // VISION_SENSOR_PROCESSOR_H_ |