blob: 933c95ee7c9341b2537faa98ea489e478cb2f48e [file] [log] [blame]
Philipp Schradere8ad6382017-04-09 21:51:21 +00001#ifndef FRC971_SHOOTER_INTERPOLATION_INTERPOLATION_H_
2#define FRC971_SHOOTER_INTERPOLATION_INTERPOLATION_H_
3
4#include <utility>
5#include <vector>
6
7namespace frc971 {
8namespace shooter_interpolation {
9
10// Struct for shot angle and power
11struct ShotParams {
12 double angle;
13 double power;
14};
15
16class InterpolationTable {
17 public:
Philipp Schrader9a833362017-04-09 22:56:16 +000018 InterpolationTable() = default;
Philipp Schradere8ad6382017-04-09 21:51:21 +000019 InterpolationTable(
Philipp Schrader9a833362017-04-09 22:56:16 +000020 const ::std::vector<::std::pair<double, ShotParams>> &table);
Philipp Schradere8ad6382017-04-09 21:51:21 +000021
22 // Uses the interpolation table to calculate the optimal shooter angle and
23 // power for a shot
Parker Schuh208a58d2017-04-12 20:51:38 -070024 ShotParams GetShooterData(double distance) const;
Philipp Schradere8ad6382017-04-09 21:51:21 +000025
26 private:
27 // Contains the list of angle entries in the interpolation table
Philipp Schrader9a833362017-04-09 22:56:16 +000028 ::std::vector<::std::pair<double, ShotParams>> table_;
Philipp Schradere8ad6382017-04-09 21:51:21 +000029};
30
31} // namespace shooter_interpolation
32} // namespace frc971
33
34#endif // FRC971_SHOOTER_INTERPOLATION_INTERPOLATION_H_