Actually go to the intake requested by the driver
Change-Id: I90bc84d1204092d0130a8c9e393825a861fa5aad
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/y2022/joystick_reader.cc b/y2022/joystick_reader.cc
index a88e552..653e1c1 100644
--- a/y2022/joystick_reader.cc
+++ b/y2022/joystick_reader.cc
@@ -286,7 +286,7 @@
flatbuffers::Offset<StaticZeroingSingleDOFProfiledSubsystemGoal>
turret_offset;
if (turret_pos.has_value()) {
- CreateStaticZeroingSingleDOFProfiledSubsystemGoal(
+ turret_offset = CreateStaticZeroingSingleDOFProfiledSubsystemGoal(
*builder.fbb(), turret_pos.value(),
CreateProfileParameters(*builder.fbb(), 12.0, 20.0));
}
@@ -315,7 +315,9 @@
superstructure_goal_builder.add_intake_front(intake_front_offset);
superstructure_goal_builder.add_intake_back(intake_back_offset);
- superstructure_goal_builder.add_turret(turret_offset);
+ if (!turret_offset.IsNull()) {
+ superstructure_goal_builder.add_turret(turret_offset);
+ }
superstructure_goal_builder.add_climber(climber_offset);
superstructure_goal_builder.add_catapult(catapult_offset);
superstructure_goal_builder.add_fire(fire);