Philipp Schrader | e8ad638 | 2017-04-09 21:51:21 +0000 | [diff] [blame^] | 1 | #ifndef FRC971_SHOOTER_INTERPOLATION_INTERPOLATION_H_ |
| 2 | #define FRC971_SHOOTER_INTERPOLATION_INTERPOLATION_H_ |
| 3 | |
| 4 | #include <utility> |
| 5 | #include <vector> |
| 6 | |
| 7 | namespace frc971 { |
| 8 | namespace shooter_interpolation { |
| 9 | |
| 10 | // Struct for shot angle and power |
| 11 | struct ShotParams { |
| 12 | double angle; |
| 13 | double power; |
| 14 | }; |
| 15 | |
| 16 | class InterpolationTable { |
| 17 | public: |
| 18 | InterpolationTable( |
| 19 | ::std::vector<::std::pair<double, ShotParams>> interpolation_table); |
| 20 | |
| 21 | // Uses the interpolation table to calculate the optimal shooter angle and |
| 22 | // power for a shot |
| 23 | ShotParams GetShooterData(double distance); |
| 24 | |
| 25 | private: |
| 26 | // Contains the list of angle entries in the interpolation table |
| 27 | ::std::vector<::std::pair<double, ShotParams>> interpolation_table_; |
| 28 | }; |
| 29 | |
| 30 | } // namespace shooter_interpolation |
| 31 | } // namespace frc971 |
| 32 | |
| 33 | #endif // FRC971_SHOOTER_INTERPOLATION_INTERPOLATION_H_ |