blob: 0774fbc7cbd61a4ee75e9ea7fceba6fa60f942a3 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001package frc971.control_loops;
2
Briana6553ed2014-04-02 21:26:46 -07003import "aos/common/controls/control_loops.q";
brians343bc112013-02-10 01:53:46 +00004
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 {
Brian Silvermanb94069c2014-04-17 14:34:24 -070026 double steering;
27 double throttle;
brians343bc112013-02-10 01:53:46 +000028 bool highgear;
29 bool quickturn;
30 bool control_loop_driving;
Brian Silvermanb94069c2014-04-17 14:34:24 -070031 double left_goal;
32 double left_velocity_goal;
33 double right_goal;
34 double 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 {
Brian Silvermanb94069c2014-04-17 14:34:24 -070046 double left_voltage;
47 double right_voltage;
Ben Fredrickson890c3fe2014-03-02 00:15:16 +000048 bool left_high;
49 bool right_high;
brians343bc112013-02-10 01:53:46 +000050 };
51
52 message Status {
Ben Fredrickson890c3fe2014-03-02 00:15:16 +000053 double robot_speed;
Austin Schuh577edf62014-04-13 10:33:05 -070054 double filtered_left_position;
55 double filtered_right_position;
Brian Silvermanb94069c2014-04-17 14:34:24 -070056
57 double uncapped_left_voltage;
58 double uncapped_right_voltage;
59 bool output_was_capped;
60
61 bool is_done;
brians343bc112013-02-10 01:53:46 +000062 };
63
64 queue Goal goal;
65 queue Position position;
66 queue Output output;
67 queue Status status;
68};
69
70queue_group Drivetrain drivetrain;