Add superstructure state machine
Managing balls from the intake into the catapult
Change-Id: I88535ee82a876d63fe49e3607c6986690d704daf
Signed-off-by: Milind Upadhyay <milind.upadhyay@gmail.com>
Signed-off-by: Ravago Jones <ravagojones@gmail.com>
diff --git a/y2022/joystick_reader.cc b/y2022/joystick_reader.cc
index a39c130..530de90 100644
--- a/y2022/joystick_reader.cc
+++ b/y2022/joystick_reader.cc
@@ -75,7 +75,6 @@
superstructure::CatapultGoal::Builder catapult_builder =
builder.MakeBuilder<superstructure::CatapultGoal>();
catapult_builder.add_return_position(catapult_return_offset);
- catapult_builder.add_fire(data.IsPressed(kFire));
catapult_builder.add_shot_position(0.3);
catapult_builder.add_shot_velocity(15.0);
flatbuffers::Offset<superstructure::CatapultGoal> catapult_offset =
@@ -84,6 +83,7 @@
superstructure::Goal::Builder goal_builder =
builder.MakeBuilder<superstructure::Goal>();
goal_builder.add_catapult(catapult_offset);
+ goal_builder.add_fire(data.IsPressed(kFire));
if (builder.Send(goal_builder.Finish()) != aos::RawSender::Error::kOk) {
AOS_LOG(ERROR, "Sending superstructure goal failed.\n");