added a force fire mode to the indexer for clearing jams
diff --git a/frc971/control_loops/index/index.cc b/frc971/control_loops/index/index.cc
index 4c82517..bec7992 100644
--- a/frc971/control_loops/index/index.cc
+++ b/frc971/control_loops/index/index.cc
@@ -833,8 +833,10 @@
disc_clamped_ = false;
disc_ejected_ = false;
if (loader_goal_ == LoaderGoal::GRAB ||
- loader_goal_ == LoaderGoal::SHOOT_AND_RESET) {
- if (loader_goal_ == LoaderGoal::GRAB) {
+ loader_goal_ == LoaderGoal::SHOOT_AND_RESET || goal->force_fire) {
+ if (goal->force_fire) {
+ LOG(INFO, "Told to force fire, moving on\n");
+ } else if (loader_goal_ == LoaderGoal::GRAB) {
LOG(INFO, "Told to GRAB, moving on\n");
} else {
LOG(INFO, "Told to SHOOT_AND_RESET, moving on\n");
@@ -862,7 +864,7 @@
loader_up_ = false;
disc_clamped_ = true;
disc_ejected_ = false;
- if (loader_goal_ == LoaderGoal::SHOOT_AND_RESET) {
+ if (loader_goal_ == LoaderGoal::SHOOT_AND_RESET || goal->force_fire) {
shooter.status.FetchLatest();
if (shooter.status.get()) {
// TODO(aschuh): If we aren't shooting nicely, wait until the shooter
diff --git a/frc971/control_loops/index/index_motor.q b/frc971/control_loops/index/index_motor.q
index b125e38..94e65b9 100644
--- a/frc971/control_loops/index/index_motor.q
+++ b/frc971/control_loops/index/index_motor.q
@@ -14,6 +14,8 @@
// 4 means shoot at will.
// 5 means re-initialize
int32_t goal_state;
+ // Forces the loader to fire.
+ bool force_fire;
};
message Position {