blob: 47195b54df0d87652d9756c350b383ac91d2ae74 [file] [log] [blame]
Austin Schuhbfb04122019-05-22 21:16:51 -07001#ifndef Y2014_ACTORS_AUTONOMOUS_ACTOR_H_
2#define Y2014_ACTORS_AUTONOMOUS_ACTOR_H_
3
4#include <chrono>
5#include <memory>
6
7#include "aos/actions/actions.h"
8#include "aos/actions/actor.h"
9#include "frc971/autonomous/base_autonomous_actor.h"
10#include "frc971/control_loops/drivetrain/drivetrain.q.h"
11#include "frc971/control_loops/drivetrain/drivetrain_config.h"
Austin Schuha3e576b2019-05-22 21:22:23 -070012#include "y2014/queues/hot_goal.q.h"
Austin Schuhbfb04122019-05-22 21:16:51 -070013
14namespace y2014 {
15namespace actors {
16
17class AutonomousActor : public ::frc971::autonomous::BaseAutonomousActor {
18 public:
19 explicit AutonomousActor(::aos::EventLoop *event_loop,
20 ::frc971::autonomous::AutonomousActionQueueGroup *s);
21
22 bool RunAction(
23 const ::frc971::autonomous::AutonomousActionParams &params) override;
24
25 private:
26 void Reset() {
27 InitializeEncoders();
28 ResetDrivetrain();
29 }
30
31 void PositionClawVertically(double intake_power, double centering_power);
32 void PositionClawBackIntake();
33 void PositionClawUpClosed();
34 void PositionClawForShot();
35 void SetShotPower(double power);
36 void Shoot();
37
38 bool WaitUntilClawDone();
Austin Schuha3e576b2019-05-22 21:22:23 -070039
40 ::aos::Fetcher<::y2014::HotGoal> hot_goal_fetcher_;
Austin Schuhbfb04122019-05-22 21:16:51 -070041};
42
43} // namespace actors
44} // namespace y2014
45
46#endif // Y2014_ACTORS_AUTONOMOUS_ACTOR_H_