Expose More of Our Shooter Status in The Debugging Site
Signed-off-by: Niko Sohmers <nikolai@sohmers.com>
Change-Id: I9b1228bbc91b95ae2469562c009e8fbec8bf36a5
diff --git a/y2024/control_loops/superstructure/shooter.cc b/y2024/control_loops/superstructure/shooter.cc
index cc00454..837b353 100644
--- a/y2024/control_loops/superstructure/shooter.cc
+++ b/y2024/control_loops/superstructure/shooter.cc
@@ -140,13 +140,18 @@
? shooter_goal->altitude_position()
: &altitude_goal_builder->AsFlatbuffer();
- bool subsystems_in_range =
+ const bool turret_in_range =
(std::abs(turret_.estimated_position() - turret_goal->unsafe_goal()) <
- kCatapultActivationThreshold &&
- std::abs(altitude_.estimated_position() - altitude_goal->unsafe_goal()) <
- kCatapultActivationThreshold &&
- altitude_.estimated_position() >
- robot_constants_->common()->min_altitude_shooting_angle());
+ kCatapultActivationThreshold);
+ const bool altitude_in_range =
+ (std::abs(altitude_.estimated_position() - altitude_goal->unsafe_goal()) <
+ kCatapultActivationThreshold);
+ const bool altitude_above_min_angle =
+ (altitude_.estimated_position() >
+ robot_constants_->common()->min_altitude_shooting_angle());
+
+ bool subsystems_in_range =
+ (turret_in_range && altitude_in_range && altitude_above_min_angle);
const bool disabled = turret_.Correct(turret_goal, position->turret(),
turret_output == nullptr);
@@ -301,6 +306,9 @@
status_builder.add_altitude(altitude_status_offset);
status_builder.add_catapult(catapult_status_offset);
status_builder.add_catapult_state(state_);
+ status_builder.add_turret_in_range(turret_in_range);
+ status_builder.add_altitude_in_range(altitude_in_range);
+ status_builder.add_altitude_above_min_angle(altitude_above_min_angle);
if (aiming) {
status_builder.add_aimer(aimer_offset);
}
diff --git a/y2024/control_loops/superstructure/superstructure_status.fbs b/y2024/control_loops/superstructure/superstructure_status.fbs
index 8d6b14f..b728f4f 100644
--- a/y2024/control_loops/superstructure/superstructure_status.fbs
+++ b/y2024/control_loops/superstructure/superstructure_status.fbs
@@ -77,6 +77,10 @@
// Status of the aimer
aimer:AimerStatus (id: 4);
+
+ turret_in_range:bool (id: 5);
+ altitude_in_range:bool (id: 6);
+ altitude_above_min_angle:bool (id: 7);
}
// Contains status of transfer rollers