blob: 942c5b333f5df95db7fe3fff4815395a831a8b9d [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
Brian Silvermanada5f2c2015-02-01 02:41:14 -050022queue_group DrivetrainQueue {
brians343bc112013-02-10 01:53:46 +000023 implements aos.control_loops.ControlLoop;
24
25 message Goal {
Brian Silvermanb94069c2014-04-17 14:34:24 -070026 double steering;
27 double throttle;
Brian Silverman93335ae2015-01-26 20:43:39 -050028 //bool highgear;
brians343bc112013-02-10 01:53:46 +000029 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;
Brian Silverman93335ae2015-01-26 20:43:39 -050040 //double left_shifter_position;
41 //double right_shifter_position;
brians343bc112013-02-10 01:53:46 +000042 };
43
44 message Output {
Brian Silvermanb94069c2014-04-17 14:34:24 -070045 double left_voltage;
46 double right_voltage;
Ben Fredrickson890c3fe2014-03-02 00:15:16 +000047 bool left_high;
48 bool right_high;
brians343bc112013-02-10 01:53:46 +000049 };
50
51 message Status {
Ben Fredrickson890c3fe2014-03-02 00:15:16 +000052 double robot_speed;
Austin Schuh577edf62014-04-13 10:33:05 -070053 double filtered_left_position;
54 double filtered_right_position;
Austin Schuh913c2f22015-04-18 22:57:19 -070055 double filtered_left_velocity;
56 double filtered_right_velocity;
Brian Silvermanb94069c2014-04-17 14:34:24 -070057
58 double uncapped_left_voltage;
59 double uncapped_right_voltage;
60 bool output_was_capped;
61
62 bool is_done;
brians343bc112013-02-10 01:53:46 +000063 };
64
65 queue Goal goal;
66 queue Position position;
67 queue Output output;
68 queue Status status;
69};
70
Brian Silvermanada5f2c2015-02-01 02:41:14 -050071queue_group DrivetrainQueue drivetrain_queue;