blob: f6e793fdcddefb3809511e191df6a48d3657bc5a [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
8class CatchAction : public ActionBase<actions::CatchActionGroup> {
9 public:
10
11 explicit CatchAction(actions::CatchActionGroup* s);
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