blob: 03f19303be9a9ac1c4de90d87718376a32f2c24c [file] [log] [blame]
Austin Schuh3bb9a442014-02-02 16:01:45 -08001package frc971.control_loops;
2
3import "aos/common/control_loop/control_loops.q";
4
5// All angles here are 0 horizontal, positive up.
Austin Schuhcc0bf312014-02-09 00:39:29 -08006queue_group ClawGroup {
Austin Schuh3bb9a442014-02-02 16:01:45 -08007 implements aos.control_loops.ControlLoop;
8
9 message Goal {
Austin Schuhcc0bf312014-02-09 00:39:29 -080010 // The angle of the bottom claw.
Austin Schuh3bb9a442014-02-02 16:01:45 -080011 double bottom_angle;
Austin Schuhcc0bf312014-02-09 00:39:29 -080012 // How much higher the top claw is.
Austin Schuh3bb9a442014-02-02 16:01:45 -080013 double seperation_angle;
14 bool intake;
15 };
16 message Position {
Austin Schuhcc0bf312014-02-09 00:39:29 -080017 // Top claw position relative to power on.
Austin Schuh3bb9a442014-02-02 16:01:45 -080018 double top_position;
19
Austin Schuhcc0bf312014-02-09 00:39:29 -080020
21 // Three Hall Effects with respect to the top claw
Austin Schuh3bb9a442014-02-02 16:01:45 -080022 bool top_front_hall_effect;
23 int32_t top_front_hall_effect_posedge_count;
24 int32_t top_front_hall_effect_negedge_count;
25 bool top_calibration_hall_effect;
26 int32_t top_calibration_hall_effect_posedge_count;
27 int32_t top_calibration_hall_effect_negedge_count;
28 bool top_back_hall_effect;
29 int32_t top_back_hall_effect_posedge_count;
30 int32_t top_back_hall_effect_negedge_count;
Austin Schuhcc0bf312014-02-09 00:39:29 -080031
32 // The encoder value at the last posedge of any of the top claw hall effect
33 // sensors.
Austin Schuh3bb9a442014-02-02 16:01:45 -080034 double top_posedge_value;
Austin Schuhcc0bf312014-02-09 00:39:29 -080035 // The encoder value at the last negedge of any of the top claw hall effect
36 // sensors.
Austin Schuh3bb9a442014-02-02 16:01:45 -080037 double top_negedge_value;
38
Austin Schuhcc0bf312014-02-09 00:39:29 -080039 // bottom claw relative position
Austin Schuh3bb9a442014-02-02 16:01:45 -080040 double bottom_position;
Austin Schuhcc0bf312014-02-09 00:39:29 -080041
42 // Three Hall Effects with respect to the bottom claw
Austin Schuh3bb9a442014-02-02 16:01:45 -080043 bool bottom_front_hall_effect;
44 int32_t bottom_front_hall_effect_posedge_count;
45 int32_t bottom_front_hall_effect_negedge_count;
46 bool bottom_calibration_hall_effect;
47 int32_t bottom_calibration_hall_effect_posedge_count;
48 int32_t bottom_calibration_hall_effect_negedge_count;
49 bool bottom_back_hall_effect;
50 int32_t bottom_back_hall_effect_posedge_count;
51 int32_t bottom_back_hall_effect_negedge_count;
Austin Schuhcc0bf312014-02-09 00:39:29 -080052
53 // The encoder value at the last posedge of any of the bottom claw hall
54 // effect sensors.
Austin Schuh3bb9a442014-02-02 16:01:45 -080055 double bottom_posedge_value;
Austin Schuhcc0bf312014-02-09 00:39:29 -080056 // The encoder value at the last negedge of any of the bottom claw hall
57 // effect sensors.
Austin Schuh3bb9a442014-02-02 16:01:45 -080058 double bottom_negedge_value;
59 };
60
61 message Output {
62 double intake_voltage;
63 double top_claw_voltage;
64 double bottom_claw_voltage;
65 };
66
67 queue Goal goal;
68 queue Position position;
69 queue Output output;
70 queue aos.control_loops.Status status;
71};
72
Austin Schuhcc0bf312014-02-09 00:39:29 -080073queue_group ClawGroup claw_queue_group;