Add "disable_climber" and "disable_extend" to robot json files
This allows for disabling the climber and extend through robot.json files. Since the climber currently does not work it will be set to true.
Signed-off-by: Niko Sohmers <nikolai@sohmers.com>
Change-Id: I2e06d68c53a36cf6fd7a9fc6f8fb22beab78c334
diff --git a/y2024/control_loops/superstructure/superstructure.cc b/y2024/control_loops/superstructure/superstructure.cc
index 5727546..4ab5966 100644
--- a/y2024/control_loops/superstructure/superstructure.cc
+++ b/y2024/control_loops/superstructure/superstructure.cc
@@ -162,7 +162,7 @@
// considered ready to accept note from the transfer rollers. If disable
// extend is triggered, this will autoatically be false.
const bool extend_at_retracted =
- (!robot_constants_->common()->disable_extend() &&
+ (!robot_constants_->robot()->disable_extend() &&
PositionNear(extend_.position(), extend_set_points->retracted(),
kExtendThreshold));
@@ -532,7 +532,7 @@
const bool collided = collision_avoidance_.IsCollided({
.intake_pivot_position = intake_pivot_.estimated_position(),
.turret_position = shooter_.turret().estimated_position(),
- .extend_position = ((!robot_constants_->common()->disable_extend())
+ .extend_position = ((!robot_constants_->robot()->disable_extend())
? extend_.estimated_position()
: 0.0),
});
@@ -642,10 +642,15 @@
status->fbb());
// Zero out extend voltage if "disable_extend" is true
- if (robot_constants_->common()->disable_extend()) {
+ if (robot_constants_->robot()->disable_extend()) {
output_struct.extend_voltage = 0.0;
}
+ // Zero out climber voltage if "disable_climber" is true
+ if (robot_constants_->robot()->disable_climber()) {
+ output_struct.climber_voltage = 0.0;
+ }
+
if (output) {
output->CheckOk(output->Send(Output::Pack(*output->fbb(), &output_struct)));
}