Austin Schuh | 3bb9a44 | 2014-02-02 16:01:45 -0800 | [diff] [blame] | 1 | package frc971.control_loops; |
| 2 | |
| 3 | import "aos/common/control_loop/control_loops.q"; |
| 4 | |
| 5 | // All angles here are 0 horizontal, positive up. |
Austin Schuh | cc0bf31 | 2014-02-09 00:39:29 -0800 | [diff] [blame^] | 6 | queue_group ClawGroup { |
Austin Schuh | 3bb9a44 | 2014-02-02 16:01:45 -0800 | [diff] [blame] | 7 | implements aos.control_loops.ControlLoop; |
| 8 | |
| 9 | message Goal { |
Austin Schuh | cc0bf31 | 2014-02-09 00:39:29 -0800 | [diff] [blame^] | 10 | // The angle of the bottom claw. |
Austin Schuh | 3bb9a44 | 2014-02-02 16:01:45 -0800 | [diff] [blame] | 11 | double bottom_angle; |
Austin Schuh | cc0bf31 | 2014-02-09 00:39:29 -0800 | [diff] [blame^] | 12 | // How much higher the top claw is. |
Austin Schuh | 3bb9a44 | 2014-02-02 16:01:45 -0800 | [diff] [blame] | 13 | double seperation_angle; |
| 14 | bool intake; |
| 15 | }; |
| 16 | message Position { |
Austin Schuh | cc0bf31 | 2014-02-09 00:39:29 -0800 | [diff] [blame^] | 17 | // Top claw position relative to power on. |
Austin Schuh | 3bb9a44 | 2014-02-02 16:01:45 -0800 | [diff] [blame] | 18 | double top_position; |
| 19 | |
Austin Schuh | cc0bf31 | 2014-02-09 00:39:29 -0800 | [diff] [blame^] | 20 | |
| 21 | // Three Hall Effects with respect to the top claw |
Austin Schuh | 3bb9a44 | 2014-02-02 16:01:45 -0800 | [diff] [blame] | 22 | bool top_front_hall_effect; |
| 23 | int32_t top_front_hall_effect_posedge_count; |
| 24 | int32_t top_front_hall_effect_negedge_count; |
| 25 | bool top_calibration_hall_effect; |
| 26 | int32_t top_calibration_hall_effect_posedge_count; |
| 27 | int32_t top_calibration_hall_effect_negedge_count; |
| 28 | bool top_back_hall_effect; |
| 29 | int32_t top_back_hall_effect_posedge_count; |
| 30 | int32_t top_back_hall_effect_negedge_count; |
Austin Schuh | cc0bf31 | 2014-02-09 00:39:29 -0800 | [diff] [blame^] | 31 | |
| 32 | // The encoder value at the last posedge of any of the top claw hall effect |
| 33 | // sensors. |
Austin Schuh | 3bb9a44 | 2014-02-02 16:01:45 -0800 | [diff] [blame] | 34 | double top_posedge_value; |
Austin Schuh | cc0bf31 | 2014-02-09 00:39:29 -0800 | [diff] [blame^] | 35 | // The encoder value at the last negedge of any of the top claw hall effect |
| 36 | // sensors. |
Austin Schuh | 3bb9a44 | 2014-02-02 16:01:45 -0800 | [diff] [blame] | 37 | double top_negedge_value; |
| 38 | |
Austin Schuh | cc0bf31 | 2014-02-09 00:39:29 -0800 | [diff] [blame^] | 39 | // bottom claw relative position |
Austin Schuh | 3bb9a44 | 2014-02-02 16:01:45 -0800 | [diff] [blame] | 40 | double bottom_position; |
Austin Schuh | cc0bf31 | 2014-02-09 00:39:29 -0800 | [diff] [blame^] | 41 | |
| 42 | // Three Hall Effects with respect to the bottom claw |
Austin Schuh | 3bb9a44 | 2014-02-02 16:01:45 -0800 | [diff] [blame] | 43 | bool bottom_front_hall_effect; |
| 44 | int32_t bottom_front_hall_effect_posedge_count; |
| 45 | int32_t bottom_front_hall_effect_negedge_count; |
| 46 | bool bottom_calibration_hall_effect; |
| 47 | int32_t bottom_calibration_hall_effect_posedge_count; |
| 48 | int32_t bottom_calibration_hall_effect_negedge_count; |
| 49 | bool bottom_back_hall_effect; |
| 50 | int32_t bottom_back_hall_effect_posedge_count; |
| 51 | int32_t bottom_back_hall_effect_negedge_count; |
Austin Schuh | cc0bf31 | 2014-02-09 00:39:29 -0800 | [diff] [blame^] | 52 | |
| 53 | // The encoder value at the last posedge of any of the bottom claw hall |
| 54 | // effect sensors. |
Austin Schuh | 3bb9a44 | 2014-02-02 16:01:45 -0800 | [diff] [blame] | 55 | double bottom_posedge_value; |
Austin Schuh | cc0bf31 | 2014-02-09 00:39:29 -0800 | [diff] [blame^] | 56 | // The encoder value at the last negedge of any of the bottom claw hall |
| 57 | // effect sensors. |
Austin Schuh | 3bb9a44 | 2014-02-02 16:01:45 -0800 | [diff] [blame] | 58 | double bottom_negedge_value; |
| 59 | }; |
| 60 | |
| 61 | message Output { |
| 62 | double intake_voltage; |
| 63 | double top_claw_voltage; |
| 64 | double bottom_claw_voltage; |
| 65 | }; |
| 66 | |
| 67 | queue Goal goal; |
| 68 | queue Position position; |
| 69 | queue Output output; |
| 70 | queue aos.control_loops.Status status; |
| 71 | }; |
| 72 | |
Austin Schuh | cc0bf31 | 2014-02-09 00:39:29 -0800 | [diff] [blame^] | 73 | queue_group ClawGroup claw_queue_group; |