Tune speaker & shuttle shots
Includes ability to have more "stable" auto-aim shuttle shot that does
not rely on x/y of localizer.
Change-Id: I6b76cd8f8436b61bb2f40966dfa8e28a44e85297
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2024/control_loops/superstructure/aiming.cc b/y2024/control_loops/superstructure/aiming.cc
index a2e92fd..d8d336f 100644
--- a/y2024/control_loops/superstructure/aiming.cc
+++ b/y2024/control_loops/superstructure/aiming.cc
@@ -52,8 +52,6 @@
if (status == nullptr) {
return;
}
- const frc971::control_loops::Pose robot_pose({status->x(), status->y(), 0},
- status->theta());
aos::Alliance alliance = aos::Alliance::kRed;
if (!joystick_state_fetcher_.Fetch() && !received_joystick_state_) {
received_joystick_state_ = false;
@@ -64,6 +62,15 @@
alliance = joystick_state_fetcher_->alliance();
}
+ const bool ignore_localizer_pos =
+ auto_aim_mode == AutoAimMode::TURRET_SHUTTLE;
+ const Eigen::Vector3d ignore_localizer_position{
+ 0.0 * (alliance == aos::Alliance::kRed ? 1.0 : -1.0), -1.0, 0.0};
+ const frc971::control_loops::Pose robot_pose(
+ ignore_localizer_pos ? ignore_localizer_position
+ : Eigen::Vector3d{status->x(), status->y(), 0},
+ status->theta());
+
frc971::shooter_interpolation::InterpolationTable<
y2024::constants::Values::ShotParams> *current_interpolation_table =
interpolation_tables_.at(auto_aim_mode);