Allow for disabling of shifting using hall effects.
There is a new constant that, if set to true, will make it simply
set the shifter pistons and not try to velocity match. This is
for the third robot, in which the analog hall effect sensors on
the shifters may never end up working correctly.
Change-Id: I344e4cf9fcca4fd32347da56d8b48e8a9fd5332e
diff --git a/frc971/control_loops/drivetrain/drivetrain.cc b/frc971/control_loops/drivetrain/drivetrain.cc
index dba72d4..8cc1e62 100644
--- a/frc971/control_loops/drivetrain/drivetrain.cc
+++ b/frc971/control_loops/drivetrain/drivetrain.cc
@@ -409,7 +409,8 @@
const double right_middle_shifter_position =
(values.right_drive.clear_high + values.right_drive.clear_low) / 2.0;
- if (position->left_shifter_position < left_middle_shifter_position) {
+ if (position->left_shifter_position < left_middle_shifter_position ||
+ left_gear_ == LOW) {
if (position->right_shifter_position < right_middle_shifter_position ||
right_gear_ == LOW) {
gear_logging.left_loop_high = false;
@@ -422,7 +423,7 @@
}
} else {
if (position->right_shifter_position < right_middle_shifter_position ||
- left_gear_ == LOW) {
+ right_gear_ == LOW) {
gear_logging.left_loop_high = true;
gear_logging.right_loop_high = false;
loop_->set_controller_index(gear_logging.controller_index = 2);