blob: 5529d36aacab02fb2b20a55ea7ff8c5b16c436fe [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 Schuh1bf8a212019-05-26 22:13:14 -070012#include "y2014/actors/shoot_actor.h"
Austin Schuh7eed2de2019-05-25 14:34:40 -070013#include "y2014/queues/auto_mode.q.h"
Austin Schuha3e576b2019-05-22 21:22:23 -070014#include "y2014/queues/hot_goal.q.h"
Austin Schuhbfb04122019-05-22 21:16:51 -070015
16namespace y2014 {
17namespace actors {
18
19class AutonomousActor : public ::frc971::autonomous::BaseAutonomousActor {
20 public:
Austin Schuh1bf8a212019-05-26 22:13:14 -070021 explicit AutonomousActor(::aos::EventLoop *event_loop);
Austin Schuhbfb04122019-05-22 21:16:51 -070022
23 bool RunAction(
24 const ::frc971::autonomous::AutonomousActionParams &params) override;
25
26 private:
27 void Reset() {
28 InitializeEncoders();
29 ResetDrivetrain();
30 }
31
32 void PositionClawVertically(double intake_power, double centering_power);
33 void PositionClawBackIntake();
34 void PositionClawUpClosed();
35 void PositionClawForShot();
36 void SetShotPower(double power);
37 void Shoot();
38
39 bool WaitUntilClawDone();
Austin Schuha3e576b2019-05-22 21:22:23 -070040
Austin Schuh7eed2de2019-05-25 14:34:40 -070041 ::aos::Fetcher<::y2014::sensors::AutoMode> auto_mode_fetcher_;
Austin Schuha3e576b2019-05-22 21:22:23 -070042 ::aos::Fetcher<::y2014::HotGoal> hot_goal_fetcher_;
Austin Schuh1bf8a212019-05-26 22:13:14 -070043
44 actors::ShootActor::Factory shoot_action_factory_;
Austin Schuhbfb04122019-05-22 21:16:51 -070045};
46
47} // namespace actors
48} // namespace y2014
49
50#endif // Y2014_ACTORS_AUTONOMOUS_ACTOR_H_