make the queues for this year's robot match the hardware better
Change-Id: Icada3ff4a7fc24e1ba1fea2e60945db8ebb23948
diff --git a/frc971/control_loops/claw/claw.gyp b/frc971/control_loops/claw/claw.gyp
new file mode 100644
index 0000000..4c65994
--- /dev/null
+++ b/frc971/control_loops/claw/claw.gyp
@@ -0,0 +1,22 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'claw_queues',
+ 'type': 'static_library',
+ 'sources': ['claw.q'],
+ 'variables': {
+ 'header_path': 'frc971/control_loops/claw',
+ },
+ 'dependencies': [
+ '<(AOS)/common/controls/controls.gyp:control_loop_queues',
+ '<(DEPTH)/frc971/control_loops/control_loops.gyp:queues',
+ ],
+ 'export_dependent_settings': [
+ '<(AOS)/common/controls/controls.gyp:control_loop_queues',
+ '<(DEPTH)/frc971/control_loops/control_loops.gyp:queues',
+
+ ],
+ 'includes': ['../../../aos/build/queues.gypi'],
+ },
+ ],
+}
diff --git a/frc971/control_loops/claw/claw.q b/frc971/control_loops/claw/claw.q
index 38252d7..51659be 100644
--- a/frc971/control_loops/claw/claw.q
+++ b/frc971/control_loops/claw/claw.q
@@ -1,57 +1,39 @@
package frc971.control_loops;
import "aos/common/controls/control_loops.q";
+import "frc971/control_loops/control_loops.q";
queue_group Claw {
implements aos.control_loops.ControlLoop;
- // NOTE: Unless otherwise specified, assume that all angle measures are in
- // radians. An angle of zero means that the appendage is sticking straight out
- // horizontally, pointing towards the front of the robot. Rotating the appendage
- // up and towards the back of the robot increases the angle, moving it down
- // and towards the back decreases it. (Think unit circle.) This rule holds
- // true for both angle goals and encoder positions.
- // Also note that unless otherwise specified, potentiometer readings are
- // from 0V to 5V. As with the encoders, moving up and towards the back
- // of the robot increases this value, moving down and towards the back
- // decreases it.
- // For all output voltage parameters, assume that a positive voltage moves
- // the appendage in a direction that increases the value of the encoder, and
- // vice versa. (For an output voltage parameter for something without an
- // encoder, directions will be individually specified.)
+ // All angles are in radians with 0 sticking straight out the front. Rotating
+ // up and into the robot is positive. Positive output voltage moves in the
+ // direction of positive encoder values.
message Goal {
- // Angle of shoulder joint.
+ // Angle of wrist joint.
double angle;
// Voltage of intake rollers. Positive means sucking in, negative means
// spitting out.
double intake;
- // Should claw be in open or closed position? (true means open.)
- bool open;
+ // true to signal the rollers to close.
+ bool rollers_closed;
};
message Position {
- // Position of shoulder joint from encoder.
- double encoder_pos;
- // Reading from potentiometer.
- double pot_pos;
- // Position of encoder at last index pulse.
- double last_index;
- // Reading from potentiometer at last index pulse.
- double last_index_pot;
- // A count of how many index pulses we've seen on the shoulder encoder.
- uint32_t index_pulses;
+ PotAndIndexPair joint;
};
message Output {
// Voltage for intake motors. Positive is sucking in, negative is spitting
// out.
double intake_voltage;
- // Voltage for shoulder motors.
- double shoulder_voltage;
- // Claw in opened or closed position. (true means open.)
- bool open;
+ // Voltage for claw motor.
+ double voltage;
+
+ // true to signal the rollers to close.
+ bool rollers_closed;
};
message Status {
@@ -59,6 +41,13 @@
bool zeroed;
// Has claw zeroed and reached goal?
bool done;
+
+ // True iff there has been enough time since we actuated the rollers outward
+ // that they should be there.
+ bool rollers_open;
+ // True iff there has been enough time since we actuated the rollers closed
+ // that they should be there.
+ bool rollers_close;
};
queue Goal goal;