added notes about a problem we saw
diff --git a/frc971/control_loops/claw/claw.cc b/frc971/control_loops/claw/claw.cc
index c38fd23..600f83d 100644
--- a/frc971/control_loops/claw/claw.cc
+++ b/frc971/control_loops/claw/claw.cc
@@ -305,6 +305,7 @@
ComputeCalibrationChange(edge_encoder, edge_angle);
LOG(INFO, "Top calibration error is %f\n", calibration_error);
if (::std::abs(calibration_error) > kRezeroThreshold) {
+ LOG(WARNING, "rezeroing top\n");
SetCalibration(edge_encoder, edge_angle);
set_zeroing_state(ZeroedStateFeedbackLoop::APPROXIMATE_CALIBRATION);
}
@@ -321,6 +322,7 @@
ComputeCalibrationChange(edge_encoder, edge_angle);
LOG(INFO, "Bottom calibration error is %f\n", calibration_error);
if (::std::abs(calibration_error) > kRezeroThreshold) {
+ LOG(WARNING, "rezeroing bottom\n");
SetCalibration(edge_encoder, edge_angle);
set_zeroing_state(ZeroedStateFeedbackLoop::APPROXIMATE_CALIBRATION);
}
@@ -685,6 +687,8 @@
if (::std::abs(bottom_absolute_position() -
values.claw.start_fine_tune_pos) <
values.claw.claw_unimportant_epsilon) {
+ // TODO(brians): I think we should check if we're on the magnet here
+ // and completely invalidate our position if so.
doing_calibration_fine_tune_ = true;
bottom_claw_goal_ += values.claw.claw_zeroing_speed * dt;
top_claw_velocity_ = bottom_claw_velocity_ =
@@ -725,6 +729,8 @@
doing_calibration_fine_tune_ = false;
LOG(DEBUG, "Calibrated the bottom correctly!\n");
} else if (bottom_claw_.calibration().last_value()) {
+ LOG(DEBUG, "Aborting bottom fine tune because sensor triggered\n");
+ // TODO(brians): This condition for aborting doesn't make much sense.
doing_calibration_fine_tune_ = false;
bottom_claw_goal_ = values.claw.start_fine_tune_pos;
top_claw_velocity_ = bottom_claw_velocity_ = 0.0;
@@ -742,6 +748,8 @@
if (::std::abs(top_absolute_position() -
values.claw.start_fine_tune_pos) <
values.claw.claw_unimportant_epsilon) {
+ // TODO(brians): I think we should check if we're on the magnet here
+ // and completely invalidate our position if so.
doing_calibration_fine_tune_ = true;
top_claw_goal_ += values.claw.claw_zeroing_speed * dt;
top_claw_velocity_ = bottom_claw_velocity_ =
@@ -781,6 +789,8 @@
doing_calibration_fine_tune_ = false;
LOG(DEBUG, "Calibrated the top correctly!\n");
} else if (top_claw_.calibration().last_value()) {
+ LOG(DEBUG, "Aborting top fine tune because sensor triggered\n");
+ // TODO(brians): This condition for aborting doesn't make much sense.
doing_calibration_fine_tune_ = false;
top_claw_goal_ = values.claw.start_fine_tune_pos;
top_claw_velocity_ = bottom_claw_velocity_ = 0.0;
diff --git a/frc971/control_loops/hall_effect_tracker.h b/frc971/control_loops/hall_effect_tracker.h
index b63a34b..4e3981e 100644
--- a/frc971/control_loops/hall_effect_tracker.h
+++ b/frc971/control_loops/hall_effect_tracker.h
@@ -8,6 +8,7 @@
namespace frc971 {
// TODO(brians): Have a Reset() for when the cape resets.
+// TODO(aschuh): Can we filter for 2 cycles instead of just 1?
class HallEffectTracker {
public:
int32_t get_posedges() const { return posedges_.count(); }