Alex Perry | 731b460 | 2019-02-02 22:13:01 -0800 | [diff] [blame^] | 1 | #ifndef FRC971_CONTROL_LOOPS_DRIVETRAIN_SPLINEDRIVETRAIN_H_ |
| 2 | #define FRC971_CONTROL_LOOPS_DRIVETRAIN_SPLINEDRIVETRAIN_H_ |
| 3 | |
| 4 | #include "frc971/control_loops/drivetrain/distance_spline.h" |
| 5 | #include "frc971/control_loops/drivetrain/drivetrain.q.h" |
| 6 | #include "frc971/control_loops/drivetrain/drivetrain_config.h" |
| 7 | #include "frc971/control_loops/drivetrain/spline.h" |
| 8 | #include "frc971/control_loops/drivetrain/trajectory.h" |
| 9 | |
| 10 | namespace frc971 { |
| 11 | namespace control_loops { |
| 12 | namespace drivetrain { |
| 13 | |
| 14 | class SplineDrivetrain { |
| 15 | public: |
| 16 | SplineDrivetrain(const DrivetrainConfig<double> &dt_config); |
| 17 | |
| 18 | void SetGoal(const ::frc971::control_loops::DrivetrainQueue::Goal &goal); |
| 19 | |
| 20 | void SetOutput( |
| 21 | ::frc971::control_loops::DrivetrainQueue::Output *output); |
| 22 | // TODO(alex): What status do we need? |
| 23 | void PopulateStatus( |
| 24 | ::frc971::control_loops::DrivetrainQueue::Status *status) const; |
| 25 | private: |
| 26 | const DrivetrainConfig<double> dt_config_; |
| 27 | |
| 28 | uint32_t current_spline_handle_; // Current spline told to excecute. |
| 29 | uint32_t current_spline_idx_; // Current excecuting spline. |
| 30 | ::std::unique_ptr<DistanceSpline> distance_spline_; |
| 31 | ::std::unique_ptr<Trajectory> current_trajectory_; |
| 32 | ::std::vector<::Eigen::Matrix<double, 3, 1>> current_xva_plan_; |
| 33 | size_t current_xva_idx_; |
| 34 | }; |
| 35 | |
| 36 | } // namespace drivetrain |
| 37 | } // namespace control_loops |
| 38 | } // namespace frc971 |
| 39 | |
| 40 | #endif // FRC971_CONTROL_LOOPS_DRIVETRAIN_SPLINEDRIVETRAIN_H_ |