blob: ff4c8b81190e723e3e8c3c5c33f8b89a54af490c [file] [log] [blame]
Brian Silvermanb601d892015-12-20 18:24:38 -05001package y2014.control_loops;
Brian Silverman17f503e2015-08-02 18:17:18 -07002
John Park33858a32018-09-28 23:05:48 -07003import "aos/controls/control_loops.q";
Brian Silverman17f503e2015-08-02 18:17:18 -07004import "frc971/control_loops/control_loops.q";
5
6struct HalfClawPosition {
7 // The current position of this half of the claw.
8 double position;
9
10 // The hall effect sensor at the front limit.
Brian Silvermanb601d892015-12-20 18:24:38 -050011 .frc971.HallEffectStruct front;
Brian Silverman17f503e2015-08-02 18:17:18 -070012 // The hall effect sensor in the middle to use for real calibration.
Brian Silvermanb601d892015-12-20 18:24:38 -050013 .frc971.HallEffectStruct calibration;
Brian Silverman17f503e2015-08-02 18:17:18 -070014 // The hall effect at the back limit.
Brian Silvermanb601d892015-12-20 18:24:38 -050015 .frc971.HallEffectStruct back;
Brian Silverman17f503e2015-08-02 18:17:18 -070016};
17
18// All angles here are 0 vertical, positive "up" (aka backwards).
Austin Schuhb2461f42019-06-29 18:17:06 -070019// Published on ".y2014.control_loops.claw_queue"
Brian Silvermanbe5ded62015-05-14 00:23:49 -040020queue_group ClawQueue {
Brian Silverman17f503e2015-08-02 18:17:18 -070021 implements aos.control_loops.ControlLoop;
22
23 message Goal {
24 // The angle of the bottom claw.
25 double bottom_angle;
26 // How much higher the top claw is.
27 double separation_angle;
28 // top claw intake roller
29 double intake;
30 // bottom claw tusk centering
31 double centering;
32 };
33
34 message Position {
35 // All the top claw information.
36 HalfClawPosition top;
37 // All the bottom claw information.
38 HalfClawPosition bottom;
39 };
40
41 message Output {
42 double intake_voltage;
43 double top_claw_voltage;
44 double bottom_claw_voltage;
45 double tusk_voltage;
46 };
47
48 message Status {
49 // True if zeroed enough for the current period (autonomous or teleop).
50 bool zeroed;
51 // True if zeroed as much as we will force during autonomous.
52 bool zeroed_for_auto;
53 // True if zeroed and within tolerance for separation and bottom angle.
54 bool done;
55 // True if zeroed and within tolerance for separation and bottom angle.
56 // seperation allowance much wider as a ball may be included
57 bool done_with_ball;
58 // Dump the values of the state matrix.
59 double bottom;
60 double bottom_velocity;
61 double separation;
62 double separation_velocity;
63 };
64
65 queue Goal goal;
66 queue Position position;
67 queue Output output;
68 queue Status status;
69};
70
Brian Silverman17f503e2015-08-02 18:17:18 -070071struct ClawPositionToLog {
72 double top;
73 double bottom;
74};