blob: 1ca5746ec4e4a2ae150ff8737d48ce29c78b638d [file] [log] [blame]
Daniel Petti663fef02015-01-22 21:43:00 -08001package frc971.control_loops;
2
3import "aos/common/controls/control_loops.q";
Brian Silverman0a7f6062015-01-24 17:41:33 -05004import "frc971/control_loops/control_loops.q";
Daniel Petti663fef02015-01-22 21:43:00 -08005
Ben Fredrickson6b5ba792015-01-25 17:14:40 -08006queue_group ClawQueue {
Daniel Petti663fef02015-01-22 21:43:00 -08007 implements aos.control_loops.ControlLoop;
8
Brian Silverman0a7f6062015-01-24 17:41:33 -05009 // All angles are in radians with 0 sticking straight out the front. Rotating
10 // up and into the robot is positive. Positive output voltage moves in the
11 // direction of positive encoder values.
Daniel Petti663fef02015-01-22 21:43:00 -080012
13 message Goal {
Brian Silverman0a7f6062015-01-24 17:41:33 -050014 // Angle of wrist joint.
Daniel Petti663fef02015-01-22 21:43:00 -080015 double angle;
16 // Voltage of intake rollers. Positive means sucking in, negative means
17 // spitting out.
18 double intake;
19
Brian Silverman0a7f6062015-01-24 17:41:33 -050020 // true to signal the rollers to close.
21 bool rollers_closed;
Daniel Petti663fef02015-01-22 21:43:00 -080022 };
23
24 message Position {
Daniel Petti3d2a3132015-01-25 09:40:03 -080025 PotAndIndexPosition joint;
Daniel Petti663fef02015-01-22 21:43:00 -080026 };
27
28 message Output {
29 // Voltage for intake motors. Positive is sucking in, negative is spitting
30 // out.
31 double intake_voltage;
Brian Silverman0a7f6062015-01-24 17:41:33 -050032 // Voltage for claw motor.
33 double voltage;
34
35 // true to signal the rollers to close.
36 bool rollers_closed;
Daniel Petti663fef02015-01-22 21:43:00 -080037 };
38
39 message Status {
40 // Is claw zeroed?
41 bool zeroed;
42 // Has claw zeroed and reached goal?
43 bool done;
Brian Silverman0a7f6062015-01-24 17:41:33 -050044
Ben Fredrickson6b5ba792015-01-25 17:14:40 -080045 // Angle of wrist joint.
46 double angle;
47 // Voltage of intake rollers. Positive means sucking in, negative means
48 // spitting out.
49 double intake;
50
Brian Silverman0a7f6062015-01-24 17:41:33 -050051 // True iff there has been enough time since we actuated the rollers outward
52 // that they should be there.
53 bool rollers_open;
54 // True iff there has been enough time since we actuated the rollers closed
55 // that they should be there.
56 bool rollers_close;
Daniel Petti663fef02015-01-22 21:43:00 -080057 };
58
59 queue Goal goal;
60 queue Position position;
61 queue Output output;
62 queue Status status;
63};
64
Ben Fredrickson6b5ba792015-01-25 17:14:40 -080065queue_group ClawQueue claw_queue;
66