James Kuszmaul | c0568f2 | 2014-03-05 20:33:00 -0800 | [diff] [blame] | 1 | #include "frc971/actions/catch_action.q.h" |
| 2 | #include "frc971/actions/action.h" |
| 3 | #include "aos/common/time.h" |
| 4 | |
| 5 | namespace frc971 { |
| 6 | namespace actions { |
| 7 | |
James Kuszmaul | 9d9b798 | 2014-03-05 21:15:13 -0800 | [diff] [blame^] | 8 | class CatchAction : public ActionBase<CatchActionGroup> { |
James Kuszmaul | c0568f2 | 2014-03-05 20:33:00 -0800 | [diff] [blame] | 9 | public: |
| 10 | |
James Kuszmaul | 9d9b798 | 2014-03-05 21:15:13 -0800 | [diff] [blame^] | 11 | explicit CatchAction(CatchActionGroup* s); |
James Kuszmaul | c0568f2 | 2014-03-05 20:33:00 -0800 | [diff] [blame] | 12 | |
| 13 | // Actually executes the action of moving the claw into position and closing |
| 14 | // it. |
| 15 | void RunAction(); |
| 16 | |
| 17 | static constexpr double kCatchSeparation = 1.0; |
| 18 | static constexpr double kCatchIntake = 12.0; |
| 19 | static constexpr double kSonarTriggerDist = 0.8; |
| 20 | static constexpr double kCatchCentering = 12.0; |
| 21 | static constexpr double kFinishAngle = 0.2; |
| 22 | |
| 23 | protected: |
| 24 | // ready for shot |
| 25 | bool DonePreShotOpen(); |
| 26 | // in the right place |
| 27 | bool DoneSetupCatch(); |
| 28 | // sonar is in valid range to close |
| 29 | bool DoneFoundSonar(); |
| 30 | // Claw reports it is done |
| 31 | bool DoneClawWithBall(); |
| 32 | // hall effect reports the ball is in |
| 33 | bool DoneBallIn(); |
| 34 | }; |
| 35 | |
| 36 | } // namespace actions |
| 37 | } // namespace frc971 |
| 38 | |