Comran Morshed | 2f7b467 | 2016-01-23 14:27:34 +0000 | [diff] [blame^] | 1 | #include "y2016/actors/superstructure_actor.h" |
| 2 | |
| 3 | #include "aos/common/util/phased_loop.h" |
| 4 | #include "aos/common/logging/logging.h" |
| 5 | #include "y2016/actors/superstructure_actor.h" |
| 6 | #include "y2016/control_loops/superstructure/superstructure.q.h" |
| 7 | |
| 8 | namespace y2016 { |
| 9 | namespace actors { |
| 10 | |
| 11 | SuperstructureActor::SuperstructureActor( |
| 12 | actors::SuperstructureActionQueueGroup* s) |
| 13 | : aos::common::actions::ActorBase<actors::SuperstructureActionQueueGroup>( |
| 14 | s) {} |
| 15 | |
| 16 | bool SuperstructureActor::RunAction( |
| 17 | const actors::SuperstructureActionParams& params) { |
| 18 | LOG(INFO, "Starting superstructure action with value %f", params.value); |
| 19 | |
| 20 | while (true) { |
| 21 | control_loops::superstructure_queue.status.FetchLatest(); |
| 22 | ::aos::time::PhasedLoop phased_loop(::aos::time::Time::InMS(5), |
| 23 | ::aos::time::Time::InMS(5) / 2); |
| 24 | break; |
| 25 | } |
| 26 | |
| 27 | return true; |
| 28 | } |
| 29 | |
| 30 | ::std::unique_ptr<SuperstructureAction> MakeSuperstructureAction( |
| 31 | const ::y2016::actors::SuperstructureActionParams& params) { |
| 32 | return ::std::unique_ptr<SuperstructureAction>(new SuperstructureAction( |
| 33 | &::y2016::actors::superstructure_action, params)); |
| 34 | } |
| 35 | |
| 36 | } // namespace actors |
| 37 | } // namespace y2016 |