Comran Morshed | 41ed7c2 | 2015-11-04 21:03:37 +0000 | [diff] [blame^] | 1 | package y2014_bot3.control_loops; |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 2 | |
| 3 | import "aos/common/controls/control_loops.q"; |
| 4 | |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 5 | struct CIMLogging { |
| 6 | bool left_in_gear; |
| 7 | bool right_in_gear; |
| 8 | double left_motor_speed; |
| 9 | double right_motor_speed; |
| 10 | double left_velocity; |
| 11 | double right_velocity; |
| 12 | }; |
| 13 | |
Comran Morshed | 41ed7c2 | 2015-11-04 21:03:37 +0000 | [diff] [blame^] | 14 | queue_group DrivetrainQueue { |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 15 | implements aos.control_loops.ControlLoop; |
| 16 | |
| 17 | message Goal { |
| 18 | double steering; |
| 19 | double throttle; |
| 20 | bool highgear; |
| 21 | bool quickturn; |
| 22 | bool control_loop_driving; |
| 23 | double left_goal; |
| 24 | double left_velocity_goal; |
| 25 | double right_goal; |
| 26 | double right_velocity_goal; |
| 27 | }; |
| 28 | |
| 29 | message Position { |
| 30 | double left_encoder; |
| 31 | double right_encoder; |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 32 | }; |
| 33 | |
| 34 | message Output { |
| 35 | double left_voltage; |
| 36 | double right_voltage; |
| 37 | bool left_high; |
| 38 | bool right_high; |
| 39 | }; |
| 40 | |
| 41 | message Status { |
| 42 | double robot_speed; |
| 43 | double filtered_left_position; |
| 44 | double filtered_right_position; |
Comran Morshed | 41ed7c2 | 2015-11-04 21:03:37 +0000 | [diff] [blame^] | 45 | double filtered_left_velocity; |
| 46 | double filtered_right_velocity; |
Comran Morshed | e9b1292 | 2015-11-04 19:46:48 +0000 | [diff] [blame] | 47 | |
| 48 | double uncapped_left_voltage; |
| 49 | double uncapped_right_voltage; |
| 50 | bool output_was_capped; |
| 51 | |
| 52 | bool is_done; |
| 53 | }; |
| 54 | |
| 55 | queue Goal goal; |
| 56 | queue Position position; |
| 57 | queue Output output; |
| 58 | queue Status status; |
| 59 | }; |
| 60 | |
Comran Morshed | 41ed7c2 | 2015-11-04 21:03:37 +0000 | [diff] [blame^] | 61 | queue_group DrivetrainQueue drivetrain_queue; |