blob: ddc2efcba76c5dc01b4afd3f68322de527539ebd [file] [log] [blame]
Brian Silvermanb601d892015-12-20 18:24:38 -05001package y2014.control_loops;
Brian Silverman17f503e2015-08-02 18:17:18 -07002
3import "aos/common/controls/control_loops.q";
4
5struct 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
13struct 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
22queue_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 Schuha0c1e152015-11-08 14:10:13 -080042 double low_left_hall;
43 double high_left_hall;
44 double low_right_hall;
45 double high_right_hall;
Brian Silverman17f503e2015-08-02 18:17:18 -070046 };
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;
Brian Silverman17f503e2015-08-02 18:17:18 -070065 };
66
67 queue Goal goal;
68 queue Position position;
69 queue Output output;
70 queue Status status;
71};
72
73queue_group DrivetrainQueue drivetrain_queue;