Brian Silverman | d4417aa | 2014-01-18 12:45:12 -0800 | [diff] [blame] | 1 | package frc971.control_loops; |
| 2 | |
| 3 | import "aos/common/control_loop/control_looops.q"; |
| 4 | |
| 5 | queue_group ShooterLoop { |
| 6 | implements aos.control_loops.ControlLoop; |
| 7 | |
| 8 | message Goal { |
Brian Silverman | 8c30bc1 | 2014-01-18 12:49:38 -0800 | [diff] [blame^] | 9 | // The energy to load to in joules. |
Brian Silverman | d4417aa | 2014-01-18 12:45:12 -0800 | [diff] [blame] | 10 | double energy; |
Brian Silverman | 8c30bc1 | 2014-01-18 12:49:38 -0800 | [diff] [blame^] | 11 | // Shoots as soon as this is true. |
| 12 | bool shoot; |
Brian Silverman | d4417aa | 2014-01-18 12:45:12 -0800 | [diff] [blame] | 13 | }; |
| 14 | message Position { |
| 15 | bool back_hall_effect; |
Brian Silverman | 8c30bc1 | 2014-01-18 12:49:38 -0800 | [diff] [blame^] | 16 | // In meters, out is positive. |
| 17 | double position; |
| 18 | double back_calibration; |
Brian Silverman | d4417aa | 2014-01-18 12:45:12 -0800 | [diff] [blame] | 19 | }; |
| 20 | message Status { |
Brian Silverman | 8c30bc1 | 2014-01-18 12:49:38 -0800 | [diff] [blame^] | 21 | // Whether it's ready to shoot right now. |
Brian Silverman | d4417aa | 2014-01-18 12:45:12 -0800 | [diff] [blame] | 22 | bool ready; |
Brian Silverman | 8c30bc1 | 2014-01-18 12:49:38 -0800 | [diff] [blame^] | 23 | // Whether the plunger is in and out of the way of grabbing a ball. |
| 24 | bool cocked; |
| 25 | // How many times we've shot. |
| 26 | int shots; |
Brian Silverman | d4417aa | 2014-01-18 12:45:12 -0800 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | queue Goal goal; |
| 30 | queue Position position; |
| 31 | queue aos.control_loops.Output output; |
| 32 | queue Status status; |
| 33 | }; |
| 34 | |
| 35 | queue_group ShooterLoop shooter; |