blob: fe9f0ff0870cee1fd5cca4baecf61df6acbf7f62 [file] [log] [blame]
Brian Silverman68a5a012013-03-29 23:37:04 -07001#ifndef VISION_SENSOR_PROCESSOR_H_
2#define VISION_SENSOR_PROCESSOR_H_
Brian Silverman6ae77dd2013-03-29 22:28:08 -07003
Brian Silverman68a5a012013-03-29 23:37:04 -07004namespace frc971 {
Brian Silverman6ae77dd2013-03-29 22:28:08 -07005
6// struct maps a single point x to to a value f of x
7typedef struct {
8 double x;
9 double fx;
10} Interpolation;
11
Brian Silverman68a5a012013-03-29 23:37:04 -070012static 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
19static const Interpolation kMetersToShooterSpeeds[] = {
20 {10.0, 200.0},
21 {5.0, 175.0},
22};
23
24static const Interpolation kMetersToShooterAngles[] = {
25 {10.0, 0.7},
26 {5.0, 0.9},
27};
Brian Silverman6ae77dd2013-03-29 22:28:08 -070028
29double interpolate(int num_interp_vals,
30 const Interpolation *interp, double value);
31
Brian Silverman68a5a012013-03-29 23:37:04 -070032} // namespace frc971
Brian Silverman6ae77dd2013-03-29 22:28:08 -070033
Brian Silverman68a5a012013-03-29 23:37:04 -070034#endif // VISION_SENSOR_PROCESSOR_H_