blob: a3706bc7eab1bb7e015de53332ac9ef3e243bb8b [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 {
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;
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 {
53 bool is_done;
Ben Fredrickson890c3fe2014-03-02 00:15:16 +000054 double robot_speed;
brians343bc112013-02-10 01:53:46 +000055 };
56
57 queue Goal goal;
58 queue Position position;
59 queue Output output;
60 queue Status status;
61};
62
63queue_group Drivetrain drivetrain;