Resolve logical merge conflict in superstructure test
Merging the aiming code caused some merge conflicts due to turret
tuning.
Change-Id: Id1ff22fdfdfe4efc0ed7590a678b36f3438cb0f2
diff --git a/y2020/control_loops/superstructure/superstructure.cc b/y2020/control_loops/superstructure/superstructure.cc
index 9ea9eb2..224a24f 100644
--- a/y2020/control_loops/superstructure/superstructure.cc
+++ b/y2020/control_loops/superstructure/superstructure.cc
@@ -124,6 +124,9 @@
output_struct.turret_voltage +=
std::clamp(turret_velocity_sign, -kTurretFrictionVoltageLimit,
kTurretFrictionVoltageLimit);
+ output_struct.turret_voltage =
+ std::clamp(output_struct.turret_voltage, -turret_.operating_voltage(),
+ turret_.operating_voltage());
// Friction is a pain and putting a really high burden on the integrator.
const double hood_velocity_sign = hood_status->velocity() * kHoodFrictionGain;
diff --git a/y2020/control_loops/superstructure/superstructure_lib_test.cc b/y2020/control_loops/superstructure/superstructure_lib_test.cc
index b461ec6..e8f1f8d 100644
--- a/y2020/control_loops/superstructure/superstructure_lib_test.cc
+++ b/y2020/control_loops/superstructure/superstructure_lib_test.cc
@@ -893,8 +893,8 @@
RunFor(chrono::seconds(1));
superstructure_status_fetcher_.Fetch();
- EXPECT_FLOAT_EQ(kShotAngle,
- superstructure_status_fetcher_->turret()->position());
+ EXPECT_NEAR(kShotAngle, superstructure_status_fetcher_->turret()->position(),
+ 1e-4);
EXPECT_FLOAT_EQ(kShotAngle,
superstructure_status_fetcher_->aimer()->turret_position());
EXPECT_FLOAT_EQ(0,