Refactor game piece position code & latch in target selector
Move the conversions to where they belong in the superstructure code,
and make the target selector latch the game piece position while it
has a target.
Change-Id: I4cd96fad9f327a241a146024ba38bcf34dfc8564
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2023/control_loops/superstructure/superstructure_status.fbs b/y2023/control_loops/superstructure/superstructure_status.fbs
index 5381b0a..8d74bfe 100644
--- a/y2023/control_loops/superstructure/superstructure_status.fbs
+++ b/y2023/control_loops/superstructure/superstructure_status.fbs
@@ -89,7 +89,15 @@
wrist:frc971.control_loops.AbsoluteEncoderProfiledJointStatus (id: 3);
end_effector_state:EndEffectorState (id: 4);
+
game_piece:vision.Class (id: 5);
+
+ // Indicates the current lateral position of the game piece, in meters.
+ // This number will be zero when the game piece is centered, and positive if
+ // the arm + wrist are all at zero and the game piece is towards the back
+ // of the robot. This will typically mean that positive is to the robot's
+ // left
+ game_piece_position:double (id: 6);
}
root_type Status;