Parker Schuh | 18dbbb4 | 2017-10-18 21:45:33 -0700 | [diff] [blame] | 1 | package frc971.codelab; |
| 2 | |
| 3 | import "aos/common/controls/control_loops.q"; |
| 4 | import "frc971/control_loops/control_loops.q"; |
| 5 | |
| 6 | // The theme of this basic test is a simple intake system. |
| 7 | // |
| 8 | // The system will have a motor driven by the voltage returned |
| 9 | // by output, and then eventually this motor, when run enough, |
| 10 | // will trigger the limit_sensor. The hypothetical motor should shut |
| 11 | // off in that hypothetical situation to avoid hypothetical burnout. |
| 12 | queue_group BasicQueue { |
| 13 | implements aos.control_loops.ControlLoop; |
| 14 | |
| 15 | message Goal { |
| 16 | // The control loop needs to intake now. |
| 17 | bool intake; |
| 18 | }; |
| 19 | |
| 20 | message Position { |
| 21 | // This is a potential incoming sensor value letting us know |
| 22 | // if we need to be intaking. |
| 23 | bool limit_sensor; |
| 24 | }; |
| 25 | |
| 26 | message Status { |
| 27 | // Lets consumers of basic_queue.status know if |
| 28 | // the requested intake is finished. |
| 29 | bool intake_complete; |
| 30 | }; |
| 31 | |
| 32 | message Output { |
| 33 | // This would be set up to drive a hypothetical motor that would |
| 34 | // hope to intake something. |
| 35 | double intake_voltage; |
| 36 | }; |
| 37 | |
| 38 | queue Goal goal; |
| 39 | queue Position position; |
| 40 | queue Output output; |
| 41 | queue Status status; |
| 42 | }; |
| 43 | |
| 44 | queue_group BasicQueue basic_queue; |