blob: 4d5e3720940690f530c2f8dd0b6048950a87fd1a [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
6#include "aos/common/actions/actor.h"
7#include "aos/common/actions/actions.h"
8#include "y2016/actors/superstructure_action.q.h"
9
10namespace y2016 {
11namespace actors {
12
13class SuperstructureActor
14 : public ::aos::common::actions::ActorBase<SuperstructureActionQueueGroup> {
15 public:
Diana Vandenberg9cc9ab62016-04-20 21:27:47 -070016 explicit SuperstructureActor(SuperstructureActionQueueGroup *s);
Comran Morshed2f7b4672016-01-23 14:27:34 +000017
Diana Vandenberg9cc9ab62016-04-20 21:27:47 -070018 // Internal struct holding superstructure goals sent by autonomous to the
19 // loop.
20 struct SuperstructureGoal {
21 double intake;
22 double shoulder;
23 double wrist;
24 };
25 SuperstructureGoal superstructure_goal_;
26 bool RunAction(const actors::SuperstructureActionParams &params) override;
Austin Schuhfef64ac2016-04-24 19:08:01 -070027 void MoveSuperstructure(double shoulder, double shooter, bool unfold_climber);
Diana Vandenberg9cc9ab62016-04-20 21:27:47 -070028 void WaitForSuperstructure();
29 bool SuperstructureProfileDone();
30 bool SuperstructureDone();
Comran Morshed2f7b4672016-01-23 14:27:34 +000031};
32
33using SuperstructureAction =
34 ::aos::common::actions::TypedAction<SuperstructureActionQueueGroup>;
35
36// Makes a new SuperstructureActor action.
37::std::unique_ptr<SuperstructureAction> MakeSuperstructureAction(
Diana Vandenberg9cc9ab62016-04-20 21:27:47 -070038 const ::y2016::actors::SuperstructureActionParams &params);
Comran Morshed2f7b4672016-01-23 14:27:34 +000039
40} // namespace actors
41} // namespace y2016
42
43#endif // Y2016_ACTORS_SUPERSTRUCTURE_ACTOR_H_