blob: be02a33bf0fa2bc00343f431dfe253326027d9ea [file] [log] [blame]
Comran Morshed2f7b4672016-01-23 14:27:34 +00001#ifndef Y2016_ACTORS_SUPERSTRUCTURE_ACTOR_H_
2#define Y2016_ACTORS_SUPERSTRUCTURE_ACTOR_H_
3
4#include <memory>
5
John Park33858a32018-09-28 23:05:48 -07006#include "aos/actions/actor.h"
7#include "aos/actions/actions.h"
Comran Morshed2f7b4672016-01-23 14:27:34 +00008#include "y2016/actors/superstructure_action.q.h"
9
10namespace y2016 {
11namespace actors {
12
13class SuperstructureActor
14 : public ::aos::common::actions::ActorBase<SuperstructureActionQueueGroup> {
15 public:
Austin Schuh1bf8a212019-05-26 22:13:14 -070016 typedef ::aos::common::actions::TypedActionFactory<
17 SuperstructureActionQueueGroup>
18 Factory;
19
20 explicit SuperstructureActor(::aos::EventLoop *event_loop);
21
22 static Factory MakeFactory(::aos::EventLoop *event_loop) {
23 return Factory(event_loop, ".y2016.actors.superstructure_action");
24 }
Comran Morshed2f7b4672016-01-23 14:27:34 +000025
Diana Vandenberg9cc9ab62016-04-20 21:27:47 -070026 // Internal struct holding superstructure goals sent by autonomous to the
27 // loop.
28 struct SuperstructureGoal {
29 double intake;
30 double shoulder;
31 double wrist;
32 };
33 SuperstructureGoal superstructure_goal_;
34 bool RunAction(const actors::SuperstructureActionParams &params) override;
Austin Schuhfef64ac2016-04-24 19:08:01 -070035 void MoveSuperstructure(double shoulder, double shooter, bool unfold_climber);
Diana Vandenberg9cc9ab62016-04-20 21:27:47 -070036 void WaitForSuperstructure();
37 bool SuperstructureProfileDone();
38 bool SuperstructureDone();
Comran Morshed2f7b4672016-01-23 14:27:34 +000039};
40
Comran Morshed2f7b4672016-01-23 14:27:34 +000041} // namespace actors
42} // namespace y2016
43
44#endif // Y2016_ACTORS_SUPERSTRUCTURE_ACTOR_H_