blob: 443282c00f82017f765e64e3a149a1460322b29e [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001package frc971.control_loops;
2
3import "aos/common/control_loop/control_loops.q";
4
Brian Silverman61e41fd2014-02-16 19:08:50 -08005struct 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
brians343bc112013-02-10 01:53:46 +000022queue_group Drivetrain {
23 implements aos.control_loops.ControlLoop;
24
25 message Goal {
26 float steering;
27 float throttle;
28 bool highgear;
29 bool quickturn;
30 bool control_loop_driving;
31 float left_goal;
Austin Schuh4352ac62013-03-19 06:23:16 +000032 float left_velocity_goal;
brians343bc112013-02-10 01:53:46 +000033 float right_goal;
Austin Schuh4352ac62013-03-19 06:23:16 +000034 float right_velocity_goal;
brians343bc112013-02-10 01:53:46 +000035 };
36
37 message Position {
38 double left_encoder;
39 double right_encoder;
Austin Schuh427b3702013-11-02 13:44:09 -070040 double left_shifter_position;
41 double right_shifter_position;
Brian Silvermande8fd552013-11-03 15:53:42 -080042 double battery_voltage;
brians343bc112013-02-10 01:53:46 +000043 };
44
45 message Output {
46 float left_voltage;
47 float right_voltage;
Brian Silverman61e41fd2014-02-16 19:08:50 -080048 bool left_high;
49 bool right_high;
brians343bc112013-02-10 01:53:46 +000050 };
51
52 message Status {
53 bool is_done;
54 };
55
56 queue Goal goal;
57 queue Position position;
58 queue Output output;
59 queue Status status;
60};
61
62queue_group Drivetrain drivetrain;