Add shuttle auto-aim
This change prepares the code for shuttle support by adding a new button,
shot table, and shot target location for the shuttle shot.
Signed-off-by: Filip Kujawa <filip.j.kujawa@gmail.com>
Change-Id: Ic70f1b0344fcab8316553cbda4a337cf8353dfd6
diff --git a/y2024/joystick_reader.cc b/y2024/joystick_reader.cc
index fcece24..a915507 100644
--- a/y2024/joystick_reader.cc
+++ b/y2024/joystick_reader.cc
@@ -59,7 +59,7 @@
const ButtonLocation kShoot(0, 0);
const ButtonLocation kRaiseClimber(3, 2);
const ButtonLocation kRaiseFastClimber(3, 1);
-const ButtonLocation kExtraButtonOne(0, 0);
+const ButtonLocation kAimShuttle(2, 10);
const ButtonLocation kExtraButtonTwo(0, 0);
const ButtonLocation kExtraButtonThree(0, 0);
const ButtonLocation kExtraButtonFour(0, 0);
@@ -134,7 +134,13 @@
superstructure::NoteGoal::NONE);
}
auto shooter_goal = superstructure_goal_builder->add_shooter_goal();
- shooter_goal->set_auto_aim(data.IsPressed(kAutoAim));
+ if (data.IsPressed(kAutoAim)) {
+ shooter_goal->set_auto_aim(
+ control_loops::superstructure::AutoAimMode::SPEAKER);
+ } else if (data.IsPressed(kAimShuttle)) {
+ shooter_goal->set_auto_aim(
+ control_loops::superstructure::AutoAimMode::SHUTTLE);
+ }
// Updating aiming for shooter goal, only one type of aim should be possible
// at a time, auto-aiming is preferred over the setpoints.