Add force preload button
This was useful when testing with a broken intake.
Defaults to disabling the button.
Change-Id: Ia0c2c4896b675e877f19c802f77f415cb59cf3d5
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2024/joystick_reader.cc b/y2024/joystick_reader.cc
index a915507..2fb75c2 100644
--- a/y2024/joystick_reader.cc
+++ b/y2024/joystick_reader.cc
@@ -34,6 +34,8 @@
DEFINE_double(speaker_altitude_position_override, -1,
"If set, use this as the altitude angle for the fixed shot.");
+DEFINE_bool(allow_force_preload, false,
+ "If set, enable the kForcePreload button.");
namespace y2024::input::joysticks {
@@ -51,6 +53,7 @@
const ButtonLocation kCatapultLoad(2, 1);
const ButtonLocation kAmp(2, 4);
const ButtonLocation kFire(2, 8);
+const ButtonLocation kForceLoad(2, 9);
const ButtonLocation kDriverFire(1, 1);
const ButtonLocation kTrap(2, 6);
const ButtonLocation kAutoAim(1, 8);
@@ -134,6 +137,8 @@
superstructure::NoteGoal::NONE);
}
auto shooter_goal = superstructure_goal_builder->add_shooter_goal();
+ shooter_goal->set_preloaded(FLAGS_allow_force_preload &&
+ data.IsPressed(kForceLoad));
if (data.IsPressed(kAutoAim)) {
shooter_goal->set_auto_aim(
control_loops::superstructure::AutoAimMode::SPEAKER);