Tyler Chatow | f31da68 | 2017-01-22 01:39:40 +0000 | [diff] [blame^] | 1 | #ifndef Y2017_ACTORS_AUTONOMOUS_ACTOR_H_ |
| 2 | #define Y2017_ACTORS_AUTONOMOUS_ACTOR_H_ |
| 3 | |
| 4 | #include <chrono> |
| 5 | #include <memory> |
| 6 | |
| 7 | #include "aos/common/actions/actions.h" |
| 8 | #include "aos/common/actions/actor.h" |
| 9 | #include "frc971/control_loops/drivetrain/drivetrain.q.h" |
| 10 | #include "frc971/control_loops/drivetrain/drivetrain_config.h" |
| 11 | #include "y2017/actors/autonomous_action.q.h" |
| 12 | |
| 13 | namespace y2017 { |
| 14 | namespace actors { |
| 15 | using ::frc971::ProfileParameters; |
| 16 | |
| 17 | class AutonomousActor |
| 18 | : public ::aos::common::actions::ActorBase<AutonomousActionQueueGroup> { |
| 19 | public: |
| 20 | explicit AutonomousActor(AutonomousActionQueueGroup *s); |
| 21 | |
| 22 | bool RunAction(const actors::AutonomousActionParams ¶ms) override; |
| 23 | private: |
| 24 | void WaitUntilDoneOrCanceled(::std::unique_ptr<aos::common::actions::Action> |
| 25 | action); |
| 26 | }; |
| 27 | |
| 28 | typedef ::aos::common::actions::TypedAction<AutonomousActionQueueGroup> |
| 29 | AutonomousAction; |
| 30 | |
| 31 | // Makes a new AutonomousActor action. |
| 32 | ::std::unique_ptr<AutonomousAction> MakeAutonomousAction( |
| 33 | const ::y2017::actors::AutonomousActionParams ¶ms); |
| 34 | |
| 35 | } // namespace actors |
| 36 | } // namespace y2017 |
| 37 | |
| 38 | #endif // Y2017_ACTORS_AUTONOMOUS_ACTOR_H_ |