Add human player station to target selector
We may need to tune the positions of the pickup, since it depends on
where the human player slides the tray to.
Change-Id: I881f42f60647d04a09ff1fcb5db8e6eec189b93b
Signed-off-by: James Kuszmaul <jabukuszmaul@gmail.com>
diff --git a/y2023/joystick_reader.cc b/y2023/joystick_reader.cc
index 4c4b1e3..3951dfa 100644
--- a/y2023/joystick_reader.cc
+++ b/y2023/joystick_reader.cc
@@ -434,7 +434,17 @@
AOS_LOG(ERROR, "Sending superstructure goal failed.\n");
}
}
- if (placing_row.has_value()) {
+ // TODO(james): Is there a more principled way to detect Human Player
+ // pickup? Probably don't bother fixing it until/unless we add more buttons
+ // that can select human player pickup.
+ if (data.IsPressed(kHPConePickup)) {
+ auto builder = target_selector_hint_sender_.MakeBuilder();
+ auto hint_builder = builder.MakeBuilder<TargetSelectorHint>();
+ hint_builder.add_substation_pickup(true);
+ if (builder.Send(hint_builder.Finish()) != aos::RawSender::Error::kOk) {
+ AOS_LOG(ERROR, "Sending target selector hint failed.\n");
+ }
+ } else if (placing_row.has_value()) {
auto builder = target_selector_hint_sender_.MakeBuilder();
auto hint_builder = builder.MakeBuilder<TargetSelectorHint>();
hint_builder.add_row(placing_row.value());