blob: 51659beab96bec06fc9c0441c68e0e51e5eb7b30 [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
6queue_group Claw {
7 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 {
Brian Silverman0a7f6062015-01-24 17:41:33 -050025 PotAndIndexPair 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
45 // True iff there has been enough time since we actuated the rollers outward
46 // that they should be there.
47 bool rollers_open;
48 // True iff there has been enough time since we actuated the rollers closed
49 // that they should be there.
50 bool rollers_close;
Daniel Petti663fef02015-01-22 21:43:00 -080051 };
52
53 queue Goal goal;
54 queue Position position;
55 queue Output output;
56 queue Status status;
57};
58
59queue_group Claw claw;