Austin Schuh | bfb0412 | 2019-05-22 21:16:51 -0700 | [diff] [blame] | 1 | #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" |
Austin Schuh | bfb0412 | 2019-05-22 21:16:51 -0700 | [diff] [blame] | 10 | #include "frc971/control_loops/drivetrain/drivetrain_config.h" |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 11 | #include "y2014/actors/shoot_actor.h" |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 12 | #include "y2014/control_loops/shooter/shooter_goal_generated.h" |
| 13 | #include "y2014/queues/auto_mode_generated.h" |
| 14 | #include "y2014/queues/hot_goal_generated.h" |
Austin Schuh | bfb0412 | 2019-05-22 21:16:51 -0700 | [diff] [blame] | 15 | |
| 16 | namespace y2014 { |
| 17 | namespace actors { |
| 18 | |
| 19 | class AutonomousActor : public ::frc971::autonomous::BaseAutonomousActor { |
| 20 | public: |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 21 | explicit AutonomousActor(::aos::EventLoop *event_loop); |
Austin Schuh | bfb0412 | 2019-05-22 21:16:51 -0700 | [diff] [blame] | 22 | |
| 23 | bool RunAction( |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 24 | const ::frc971::autonomous::AutonomousActionParams *params) override; |
Austin Schuh | bfb0412 | 2019-05-22 21:16:51 -0700 | [diff] [blame] | 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 Schuh | a3e576b | 2019-05-22 21:22:23 -0700 | [diff] [blame] | 40 | |
Austin Schuh | 7eed2de | 2019-05-25 14:34:40 -0700 | [diff] [blame] | 41 | ::aos::Fetcher<::y2014::sensors::AutoMode> auto_mode_fetcher_; |
Austin Schuh | a3e576b | 2019-05-22 21:22:23 -0700 | [diff] [blame] | 42 | ::aos::Fetcher<::y2014::HotGoal> hot_goal_fetcher_; |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame^] | 43 | ::aos::Sender<::y2014::control_loops::claw::Goal> claw_goal_sender_; |
| 44 | ::aos::Fetcher<::y2014::control_loops::claw::Goal> claw_goal_fetcher_; |
| 45 | ::aos::Fetcher<::y2014::control_loops::claw::Status> claw_status_fetcher_; |
| 46 | ::aos::Sender<::y2014::control_loops::shooter::Goal> shooter_goal_sender_; |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 47 | |
| 48 | actors::ShootActor::Factory shoot_action_factory_; |
Austin Schuh | bfb0412 | 2019-05-22 21:16:51 -0700 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | } // namespace actors |
| 52 | } // namespace y2014 |
| 53 | |
| 54 | #endif // Y2014_ACTORS_AUTONOMOUS_ACTOR_H_ |