Claw avoids windup.
diff --git a/frc971/control_loops/claw/claw.h b/frc971/control_loops/claw/claw.h
index 20b30b6..34786b8 100755
--- a/frc971/control_loops/claw/claw.h
+++ b/frc971/control_loops/claw/claw.h
@@ -12,8 +12,7 @@
namespace frc971 {
namespace control_loops {
namespace testing {
-class ClawTest_NoWindupPositive_Test;
-class ClawTest_NoWindupNegative_Test;
+class WindupClawTest;
};
// Note: Everything in this file assumes that there is a 1 cycle delay between
@@ -241,12 +240,30 @@
// True if the state machine is ready.
bool capped_goal() const { return capped_goal_; }
+ double uncapped_average_voltage() const {
+ return claw_.uncapped_average_voltage();
+ }
+
+ // True if the claw is zeroing.
+ bool is_zeroing() const;
+
// True if the state machine is ready.
- bool is_ready() const { return false; }
+ bool is_ready() const;
void ChangeTopOffset(double doffset);
void ChangeBottomOffset(double doffset);
+ enum CalibrationMode {
+ READY,
+ PREP_FINE_TUNE_TOP,
+ FINE_TUNE_TOP,
+ PREP_FINE_TUNE_BOTTOM,
+ FINE_TUNE_BOTTOM,
+ UNKNOWN_LOCATION
+ };
+
+ CalibrationMode mode() const { return mode_; }
+
protected:
virtual void RunIteration(const control_loops::ClawGroup::Goal *goal,
const control_loops::ClawGroup::Position *position,
@@ -260,8 +277,7 @@
private:
// Friend the test classes for acces to the internal state.
- friend class testing::ClawTest_NoWindupPositive_Test;
- friend class testing::ClawTest_NoWindupNegative_Test;
+ friend class testing::WindupClawTest;
// The zeroed joint to use.
bool has_top_claw_goal_;
@@ -280,9 +296,10 @@
// The initial seperation when disabled. Used as the safe seperation
// distance.
- double initial_seperation_;
+ double initial_separation_;
bool capped_goal_;
+ CalibrationMode mode_;
DISALLOW_COPY_AND_ASSIGN(ClawMotor);
};