blob: bb875f85a99df9d08067e270660cbb86f5ca9454 [file] [log] [blame]
James Kuszmaulc0568f22014-03-05 20:33:00 -08001#include "frc971/actions/catch_action.q.h"
2#include "frc971/actions/action.h"
3#include "aos/common/time.h"
4
5namespace frc971 {
6namespace actions {
7
James Kuszmaul9d9b7982014-03-05 21:15:13 -08008class CatchAction : public ActionBase<CatchActionGroup> {
James Kuszmaulc0568f22014-03-05 20:33:00 -08009 public:
10
James Kuszmaul9d9b7982014-03-05 21:15:13 -080011 explicit CatchAction(CatchActionGroup* s);
James Kuszmaulc0568f22014-03-05 20:33:00 -080012
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