it works ok
diff --git a/frc971/autonomous/auto.cc b/frc971/autonomous/auto.cc
index 5e3db3e..673368a 100644
--- a/frc971/autonomous/auto.cc
+++ b/frc971/autonomous/auto.cc
@@ -331,8 +331,8 @@
double WRIST_UP;
const double WRIST_DOWN = -0.580;
const double WRIST_DOWN_TWO = WRIST_DOWN - 0.010;
- const double ANGLE_ONE = 0.560;
- const double ANGLE_TWO = 0.707;
+ const double ANGLE_ONE = 0.556;
+ const double ANGLE_TWO = 0.677;
ResetIndex();
SetWristGoal(1.0); // wrist must calibrate itself on power-up
@@ -340,7 +340,7 @@
SetShooterVelocity(0.0); // or else it keeps spinning from last time
ResetDrivetrain();
- ::aos::time::SleepFor(::aos::time::Time::InSeconds(20));
+ //::aos::time::SleepFor(::aos::time::Time::InSeconds(20));
if (ShouldExitAuto()) return;
::aos::robot_state.FetchLatest();
@@ -366,7 +366,7 @@
SetWristGoal(WRIST_UP); // wrist must calibrate itself on power-up
SetAngle_AdjustGoal(ANGLE_ONE);
- SetShooterVelocity(400.0);
+ SetShooterVelocity(380.0);
WaitForIndexReset();
if (ShouldExitAuto()) return;
PreloadIndex(); // spin to top and put 1 disc into loader
@@ -414,7 +414,7 @@
if (ShouldExitAuto()) return;
} else {
// Delay to let the disc out of the shooter.
- ::aos::time::SleepFor(::aos::time::Time::InSeconds(0.1));
+ ::aos::time::SleepFor(::aos::time::Time::InSeconds(0.25));
SetWristGoal(WRIST_DOWN);
StartIndex(); // take in up to 4 discs
diff --git a/frc971/constants.cpp b/frc971/constants.cpp
index 966f1c8..23a8e4e 100644
--- a/frc971/constants.cpp
+++ b/frc971/constants.cpp
@@ -17,8 +17,8 @@
namespace {
// It has about 0.029043 of gearbox slop.
-const double kCompWristHallEffectStartAngle = 1.230;
-const double kPracticeWristHallEffectStartAngle = 1.0872860614359172;
+const double kCompWristHallEffectStartAngle = 1.257;
+const double kPracticeWristHallEffectStartAngle = 1.230;
const double kCompWristHallEffectStopAngle = 100 * M_PI / 180.0;
const double kPracticeWristHallEffectStopAngle = 100 * M_PI / 180.0;
@@ -40,8 +40,8 @@
const int kAngleAdjustHallEffect = 2;
-const double kCompAngleAdjustHallEffectStartAngle[2] = {0.305172594, 1.5};
-const double kPracticeAngleAdjustHallEffectStartAngle[2] = {0.305432, 1.5};
+const double kCompAngleAdjustHallEffectStartAngle[2] = {0.286375033, 1.5};
+const double kPracticeAngleAdjustHallEffectStartAngle[2] = {0.305172594, 1.5};
const double kCompAngleAdjustHallEffectStopAngle[2] = {0.1, 1.0};
const double kPracticeAngleAdjustHallEffectStopAngle[2] = {0.1, 1.0};
diff --git a/frc971/input/JoystickReader.cc b/frc971/input/JoystickReader.cc
index 4de09e0..d46f943 100644
--- a/frc971/input/JoystickReader.cc
+++ b/frc971/input/JoystickReader.cc
@@ -121,6 +121,7 @@
shooter_goal->velocity = 0;
static double angle_adjust_goal = 0.42;
if (Pressed(2, 5)) {
+#if 0
target_angle.FetchLatest();
if (target_angle.IsNewerThanMS(500)) {
shooter_goal->velocity = target_angle->shooter_speed;
@@ -131,6 +132,10 @@
LOG(WARNING, "camera frame too old\n");
// pretend like no button is pressed
}
+#endif
+ shooter_goal->velocity = 400;
+ wrist_up_position = 1.23 - 0.4;
+ angle_adjust_goal = 0.586;
} else if (Pressed(2, 3)) {
// medium shot
#if 0
@@ -141,7 +146,7 @@
// middle wheel on the back line (same as auto)
shooter_goal->velocity = 360;
wrist_up_position = 1.23 - 0.4;
- angle_adjust_goal = 0.586;
+ angle_adjust_goal = 0.596;
} else if (Pressed(2, 6)) {
// short shot
shooter_goal->velocity = 375;
diff --git a/frc971/input/gyro_board_reader.cc b/frc971/input/gyro_board_reader.cc
index b977c2b..05adc5a 100644
--- a/frc971/input/gyro_board_reader.cc
+++ b/frc971/input/gyro_board_reader.cc
@@ -186,19 +186,19 @@
&last_shooter_angle_rise_count_, &shooter_angle_rise_count_);
drivetrain.position.MakeWithBuilder()
- .right_encoder(drivetrain_translate(data->right_drive))
- .left_encoder(-drivetrain_translate(data->left_drive))
+ .right_encoder(drivetrain_translate(data->left_drive))
+ .left_encoder(-drivetrain_translate(data->right_drive))
.Send();
wrist.position.MakeWithBuilder()
.pos(wrist_translate(data->wrist))
- .hall_effect(!data->wrist_hall_effect)
+ .hall_effect(data->wrist_hall_effect)
.calibration(wrist_translate(data->capture_wrist_rise))
.Send();
angle_adjust.position.MakeWithBuilder()
.angle(angle_adjust_translate(data->shooter_angle))
- .bottom_hall_effect(!data->angle_adjust_bottom_hall_effect)
+ .bottom_hall_effect(data->angle_adjust_bottom_hall_effect)
.middle_hall_effect(false)
.bottom_calibration(angle_adjust_translate(
data->capture_shooter_angle_rise))
@@ -212,12 +212,12 @@
index_loop.position.MakeWithBuilder()
.index_position(index_translate(data->indexer))
- .top_disc_detect(!data->top_disc)
+ .top_disc_detect(data->top_disc)
.top_disc_posedge_count(top_rise_count_)
.top_disc_posedge_position(index_translate(data->capture_top_rise))
.top_disc_negedge_count(top_fall_count_)
.top_disc_negedge_position(index_translate(data->capture_top_fall))
- .bottom_disc_detect(!data->bottom_disc)
+ .bottom_disc_detect(data->bottom_disc)
.bottom_disc_posedge_count(bottom_rise_count_)
.bottom_disc_negedge_count(bottom_fall_count_)
.bottom_disc_negedge_wait_position(index_translate(