Got angle adjust working with limiting the zeroing goal.
diff --git a/frc971/constants.cpp b/frc971/constants.cpp
index 6c7c54b..1b53c06 100644
--- a/frc971/constants.cpp
+++ b/frc971/constants.cpp
@@ -32,23 +32,6 @@
const double kPracticeWristLowerPhysicalLimit = -37.5 * M_PI / 180.0;
const double kCompWristLowerPhysicalLimit = -37.5 * M_PI / 180.0;
-const int kAngleAdjustHallEffect = 2;
-
-const ::std::array<double, kAngleAdjustHallEffect>
- kCompAngleAdjustHorizontalHallEffectStartAngle = {{-0.1, 1.0}};
-const ::std::array<double, kAngleAdjustHallEffect>
- kPracticeAngleAdjustHorizontalHallEffectStartAngle = {{-0.1, 1.0}};
-
-const ::std::array<double, kAngleAdjustHallEffect>
- kCompAngleAdjustHorizontalHallEffectStopAngle = {{0.5, 1.5}};
-const ::std::array<double, kAngleAdjustHallEffect>
- kPracticeAngleAdjustHorizontalHallEffectStopAngle = {{0.5, 1.5}};
-
-const double kPracticeAngleAdjustHorizontalUpperPhysicalLimit =
- 3.0;
-const double kCompAngleAdjustHorizontalUpperPhysicalLimit =
- 3.0;
-
const double kPracticeWristUpperLimit = 93 * M_PI / 180.0;
const double kCompWristUpperLimit = 93 * M_PI / 180.0;
@@ -57,22 +40,31 @@
const double kWristZeroingSpeed = 1.0;
-const double kPracticeAngleAdjustHorizontalLowerPhysicalLimit =
- 0.0;
-const double kCompAngleAdjustHorizontalLowerPhysicalLimit =
- 0.0;
+const int kAngleAdjustHallEffect = 2;
-const double kPracticeAngleAdjustHorizontalUpperLimit =
- 3.0;
-const double kCompAngleAdjustHorizontalUpperLimit =
- 3.0;
+const ::std::array<double, kAngleAdjustHallEffect>
+ kCompAngleAdjustHallEffectStartAngle = {{-0.1, 1.0}};
+const ::std::array<double, kAngleAdjustHallEffect>
+ kPracticeAngleAdjustHallEffectStartAngle = {{-0.1, 1.0}};
-const double kPracticeAngleAdjustHorizontalLowerLimit =
- 0.0;
-const double kCompAngleAdjustHorizontalLowerLimit =
- 0.0;
+const ::std::array<double, kAngleAdjustHallEffect>
+ kCompAngleAdjustHallEffectStopAngle = {{0.5, 1.5}};
+const ::std::array<double, kAngleAdjustHallEffect>
+ kPracticeAngleAdjustHallEffectStopAngle = {{0.5, 1.5}};
-const double kAngleAdjustHorizontalZeroingSpeed = 1.0;
+const double kPracticeAngleAdjustUpperPhysicalLimit = 3.0;
+const double kCompAngleAdjustUpperPhysicalLimit = 3.0;
+
+const double kPracticeAngleAdjustLowerPhysicalLimit = 0.0;
+const double kCompAngleAdjustLowerPhysicalLimit = 0.0;
+
+const double kPracticeAngleAdjustUpperLimit = 3.0;
+const double kCompAngleAdjustUpperLimit = 3.0;
+
+const double kPracticeAngleAdjustLowerLimit = 0.0;
+const double kCompAngleAdjustLowerLimit = 0.0;
+
+const double kAngleAdjustZeroingSpeed = 1.0;
const int kCompCameraCenter = -2;
const int kPracticeCameraCenter = -5;
@@ -94,18 +86,18 @@
double wrist_zeroing_speed;
// AngleAdjust hall effect positive and negative edges.
- ::std::array<double, 2> angle_adjust_horizontal_hall_effect_start_angle;
- ::std::array<double, 2> angle_adjust_horizontal_hall_effect_stop_angle;
+ ::std::array<double, 2> angle_adjust_hall_effect_start_angle;
+ ::std::array<double, 2> angle_adjust_hall_effect_stop_angle;
// Upper and lower extreme limits of travel for the angle adjust.
- double angle_adjust_horizontal_upper_limit;
- double angle_adjust_horizontal_lower_limit;
+ double angle_adjust_upper_limit;
+ double angle_adjust_lower_limit;
// Physical limits. These are here for testing.
- double angle_adjust_horizontal_upper_physical_limit;
- double angle_adjust_horizontal_lower_physical_limit;
+ double angle_adjust_upper_physical_limit;
+ double angle_adjust_lower_physical_limit;
// Zeroing speed.
- double angle_adjust_horizontal_zeroing_speed;
+ double angle_adjust_zeroing_speed;
// what camera_center returns
int camera_center;
@@ -129,13 +121,13 @@
kCompWristUpperPhysicalLimit,
kCompWristLowerPhysicalLimit,
kWristZeroingSpeed,
- kCompAngleAdjustHorizontalHallEffectStartAngle,
- kCompAngleAdjustHorizontalHallEffectStopAngle,
- kCompAngleAdjustHorizontalUpperLimit,
- kCompAngleAdjustHorizontalLowerLimit,
- kCompAngleAdjustHorizontalUpperPhysicalLimit,
- kCompAngleAdjustHorizontalLowerPhysicalLimit,
- kAngleAdjustHorizontalZeroingSpeed,
+ kCompAngleAdjustHallEffectStartAngle,
+ kCompAngleAdjustHallEffectStopAngle,
+ kCompAngleAdjustUpperLimit,
+ kCompAngleAdjustLowerLimit,
+ kCompAngleAdjustUpperPhysicalLimit,
+ kCompAngleAdjustLowerPhysicalLimit,
+ kAngleAdjustZeroingSpeed,
kCompCameraCenter};
break;
case kPracticeTeamNumber:
@@ -146,13 +138,13 @@
kPracticeWristUpperPhysicalLimit,
kPracticeWristLowerPhysicalLimit,
kWristZeroingSpeed,
- kPracticeAngleAdjustHorizontalHallEffectStartAngle,
- kPracticeAngleAdjustHorizontalHallEffectStopAngle,
- kPracticeAngleAdjustHorizontalUpperLimit,
- kPracticeAngleAdjustHorizontalLowerLimit,
- kPracticeAngleAdjustHorizontalUpperPhysicalLimit,
- kPracticeAngleAdjustHorizontalLowerPhysicalLimit,
- kAngleAdjustHorizontalZeroingSpeed,
+ kPracticeAngleAdjustHallEffectStartAngle,
+ kPracticeAngleAdjustHallEffectStopAngle,
+ kPracticeAngleAdjustUpperLimit,
+ kPracticeAngleAdjustLowerLimit,
+ kPracticeAngleAdjustUpperPhysicalLimit,
+ kPracticeAngleAdjustLowerPhysicalLimit,
+ kAngleAdjustZeroingSpeed,
kPracticeCameraCenter};
break;
default:
@@ -213,52 +205,52 @@
return true;
}
-bool angle_adjust_horizontal_hall_effect_start_angle(
+bool angle_adjust_hall_effect_start_angle(
::std::array<double, 2> *angle) {
const Values *const values = GetValues();
if (values == NULL) return false;
- *angle = values->angle_adjust_horizontal_hall_effect_start_angle;
+ *angle = values->angle_adjust_hall_effect_start_angle;
return true;
}
-bool angle_adjust_horizontal_hall_effect_stop_angle(
+bool angle_adjust_hall_effect_stop_angle(
::std::array<double, 2> *angle) {
const Values *const values = GetValues();
if (values == NULL) return false;
- *angle = values->angle_adjust_horizontal_hall_effect_stop_angle;
+ *angle = values->angle_adjust_hall_effect_stop_angle;
return true;
}
-bool angle_adjust_horizontal_upper_limit(double *angle) {
+bool angle_adjust_upper_limit(double *angle) {
const Values *const values = GetValues();
if (values == NULL) return false;
- *angle = values->angle_adjust_horizontal_upper_limit;
+ *angle = values->angle_adjust_upper_limit;
return true;
}
-bool angle_adjust_horizontal_lower_limit(double *angle) {
+bool angle_adjust_lower_limit(double *angle) {
const Values *const values = GetValues();
if (values == NULL) return false;
- *angle = values->angle_adjust_horizontal_lower_limit;
+ *angle = values->angle_adjust_lower_limit;
return true;
}
-bool angle_adjust_horizontal_upper_physical_limit(double *angle) {
+bool angle_adjust_upper_physical_limit(double *angle) {
const Values *const values = GetValues();
if (values == NULL) return false;
- *angle = values->angle_adjust_horizontal_upper_physical_limit;
+ *angle = values->angle_adjust_upper_physical_limit;
return true;
}
-bool angle_adjust_horizontal_lower_physical_limit(double *angle) {
+bool angle_adjust_lower_physical_limit(double *angle) {
const Values *const values = GetValues();
if (values == NULL) return false;
- *angle = values->angle_adjust_horizontal_lower_physical_limit;
+ *angle = values->angle_adjust_lower_physical_limit;
return true;
}
-bool angle_adjust_horizontal_zeroing_speed(double *speed) {
+bool angle_adjust_zeroing_speed(double *speed) {
const Values *const values = GetValues();
if (values == NULL) return false;
- *speed = values->angle_adjust_horizontal_zeroing_speed;
+ *speed = values->angle_adjust_zeroing_speed;
return true;
}