Adjust shot angle offset depending on retention roller current
This is functionally disabled currently, as it always outputs the same
shot angle offset.
Change-Id: I7bc4b3bc0ba2779d00a3d3203e67e97748b759b1
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2024/control_loops/superstructure/shooter.cc b/y2024/control_loops/superstructure/shooter.cc
index 0c52360..7fb8973 100644
--- a/y2024/control_loops/superstructure/shooter.cc
+++ b/y2024/control_loops/superstructure/shooter.cc
@@ -93,9 +93,11 @@
// Always retain the game piece if we are enabled.
if (retention_roller_output != nullptr) {
*retention_roller_output =
- robot_constants_->common()->retention_roller_voltages()->retaining();
+ robot_constants_->common()->retention_roller_voltages()->intaking();
if (piece_loaded) {
+ *retention_roller_output =
+ robot_constants_->common()->retention_roller_voltages()->retaining();
*retention_roller_stator_current_limit =
robot_constants_->common()
->current_limits()
@@ -283,9 +285,11 @@
case CatapultState::READY:
[[fallthrough]];
case CatapultState::LOADED: {
+ aimer_.latch_note_current(false);
if (piece_loaded) {
state_ = CatapultState::LOADED;
} else {
+ aimer_.IndicateReady();
state_ = CatapultState::READY;
}
@@ -311,6 +315,7 @@
[[fallthrough]];
}
case CatapultState::FIRING:
+ aimer_.latch_note_current(true);
*retention_roller_output =
robot_constants_->common()->retention_roller_voltages()->spitting();
*retention_roller_stator_current_limit =
@@ -336,6 +341,7 @@
}
[[fallthrough]];
case CatapultState::RETRACTING:
+ aimer_.latch_note_current(false);
catapult_.set_controller_index(0);
catapult_.mutable_profile()->set_maximum_acceleration(
kLoadingAcceleration);