Brian Silverman | 17f503e | 2015-08-02 18:17:18 -0700 | [diff] [blame] | 1 | package frc971.control_loops; |
| 2 | |
| 3 | import "aos/common/controls/control_loops.q"; |
| 4 | |
| 5 | struct GearLogging { |
| 6 | int8_t controller_index; |
| 7 | bool left_loop_high; |
| 8 | bool right_loop_high; |
| 9 | int8_t left_state; |
| 10 | int8_t right_state; |
| 11 | }; |
| 12 | |
| 13 | struct CIMLogging { |
| 14 | bool left_in_gear; |
| 15 | bool right_in_gear; |
| 16 | double left_motor_speed; |
| 17 | double right_motor_speed; |
| 18 | double left_velocity; |
| 19 | double right_velocity; |
| 20 | }; |
| 21 | |
| 22 | queue_group DrivetrainQueue { |
| 23 | implements aos.control_loops.ControlLoop; |
| 24 | |
| 25 | message Goal { |
| 26 | double steering; |
| 27 | double throttle; |
| 28 | bool highgear; |
| 29 | bool quickturn; |
| 30 | bool control_loop_driving; |
| 31 | double left_goal; |
| 32 | double left_velocity_goal; |
| 33 | double right_goal; |
| 34 | double right_velocity_goal; |
| 35 | }; |
| 36 | |
| 37 | message Position { |
| 38 | double left_encoder; |
| 39 | double right_encoder; |
| 40 | double left_shifter_position; |
| 41 | double right_shifter_position; |
Austin Schuh | a0c1e15 | 2015-11-08 14:10:13 -0800 | [diff] [blame^] | 42 | double low_left_hall; |
| 43 | double high_left_hall; |
| 44 | double low_right_hall; |
| 45 | double high_right_hall; |
Brian Silverman | 17f503e | 2015-08-02 18:17:18 -0700 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | message Output { |
| 49 | double left_voltage; |
| 50 | double right_voltage; |
| 51 | bool left_high; |
| 52 | bool right_high; |
| 53 | }; |
| 54 | |
| 55 | message Status { |
| 56 | double robot_speed; |
| 57 | double filtered_left_position; |
| 58 | double filtered_right_position; |
| 59 | double filtered_left_velocity; |
| 60 | double filtered_right_velocity; |
| 61 | |
| 62 | double uncapped_left_voltage; |
| 63 | double uncapped_right_voltage; |
| 64 | bool output_was_capped; |
| 65 | |
| 66 | bool is_done; |
| 67 | }; |
| 68 | |
| 69 | queue Goal goal; |
| 70 | queue Position position; |
| 71 | queue Output output; |
| 72 | queue Status status; |
| 73 | }; |
| 74 | |
| 75 | queue_group DrivetrainQueue drivetrain_queue; |