make the queues for this year's robot match the hardware better

Change-Id: Icada3ff4a7fc24e1ba1fea2e60945db8ebb23948
diff --git a/frc971/control_loops/fridge/fridge.gyp b/frc971/control_loops/fridge/fridge.gyp
new file mode 100644
index 0000000..093be4d
--- /dev/null
+++ b/frc971/control_loops/fridge/fridge.gyp
@@ -0,0 +1,22 @@
+{
+  'targets': [
+    {
+      'target_name': 'fridge_queues',
+      'type': 'static_library',
+      'sources': ['fridge.q'],
+      'variables': {
+        'header_path': 'frc971/control_loops/fridge',
+      },
+      '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/fridge/fridge.q b/frc971/control_loops/fridge/fridge.q
index 9e623b3..1abd821 100644
--- a/frc971/control_loops/fridge/fridge.q
+++ b/frc971/control_loops/fridge/fridge.q
@@ -1,77 +1,40 @@
 package frc971.control_loops;
 
 import "aos/common/controls/control_loops.q";
+import "frc971/control_loops/control_loops.q";
+
+// Represents states for all of the box-grabbing pistons.
+// true is grabbed and false is retracted for all of them.
+struct GrabberPistons {
+  bool top_front;
+  bool top_back;
+  bool bottom_front;
+  bool bottom_back;
+};
 
 queue_group Fridge {
   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 horizontally over
+  // the intake (the front). Rotating up and into the robot (towards the back
+  // where boxes are placed) is positive. Positive output voltage moves all
+  // mechanisms in the direction with positive sensor values.
 
-  // NOTE: Elevator heights are defined as follows: The height of the elevator
-  // is the vertical distance (in meters) between the top of the frame
-  // (front and back), and the arm pivot axis. A constant specifies the minimum
-  // value for this distance.
+  // Elevator heights are the vertical distance (in meters) from the top of the
+  // frame (at the front and back) to the axis of the bottom pivot of the arm.
 
   message Goal {
-    // Position of the arm in radians.
+    // Angle of the arm.
     double angle;
-    // Height of the elevator in meters.
+    // Height of the elevator.
     double height;
 
-    // Should the grabbers be deployed?
-    bool grabbers_deployed;
+    GrabberPistons grabbers;
   };
 
   message Position {
-    // Position of arm from encoder.
-    double arm_encoder_pos;
-    // Reading from arm potentiometer.
-    double arm_pot_pos;
-    // Position of arm encoder at last index pulse.
-    double arm_last_index;
-    // Reading from arm potentiometer at last index pulse.
-    double arm_last_index_pot;
-    // A count of how many index pulses we've seen on the arm encoder.
-    uint32_t arm_index_pulses;
-
-    // Height of left side from encoder.
-    double left_encoder_pos;
-    // Reading from left side potentiometer. Directions work the same for this
-    // as for the encoder.
-    double left_pot_pos;
-    // Position of left encoder at last index pulse.
-    double left_last_index;
-    // Reading from left potentiometer at last index pulse.
-    double left_last_index_pot;
-    // A count of how many index pulses we've seen on the left encoder.
-    uint32_t left_index_pulses;
-
-    // Height of right side from encoder. Directions are the same as
-    // for the left side.
-    double right_encoder_pos;
-    // Reading from right side potentiometer. Directions work the same for this
-    // as for the encoder.
-    double right_pot_pos;
-    // Position of right encoder at last index pulse.
-    double right_last_index;
-    // Reading from right potentiometer at last index pulse.
-    double right_last_index_pot;
-    // A count of how many index pulses we've seen on the right encoder.
-    uint32_t right_index_pulses;
-
+    PotAndIndexPair arm;
+    PotAndIndexPair elevator;
   };
 
   message Status {
@@ -83,15 +46,12 @@
   };
 
   message Output {
-    // Voltage of arm motor.
-    double arm_voltage;
-    // Voltage of left elevator motor.
-    double left_voltage;
-    // Voltage of right elevator motor.
-    double right_voltage;
+    double left_arm;
+    double right_arm;
+    double left_elevator;
+    double right_elevator;
 
-    // Are grabber pistons deployed?
-    bool grabbers_deployed;
+    GrabberPistons grabbers;
   };
 
   queue Goal goal;