Add option for disabling balance in auto
Used at chezy champs.
Change-Id: If9de7832c68ce1f5740d4c04ebc3d0f868de91a6
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2023/autonomous/autonomous_actor.cc b/y2023/autonomous/autonomous_actor.cc
index bedbab7..8891223 100644
--- a/y2023/autonomous/autonomous_actor.cc
+++ b/y2023/autonomous/autonomous_actor.cc
@@ -15,6 +15,7 @@
DEFINE_bool(spline_auto, false, "Run simple test S-spline auto mode.");
DEFINE_bool(charged_up, true, "If true run charged up autonomous mode");
DEFINE_bool(charged_up_cable, false, "If true run cable side autonomous mode");
+DEFINE_bool(do_balance, true, "If true run the balance.");
namespace y2023 {
namespace autonomous {
@@ -364,6 +365,7 @@
AOS_LOG(
INFO, "Placed second cube %lf s\n",
aos::time::DurationInSeconds(aos::monotonic_clock::now() - start_time));
+
InitializeEncoders();
const ProfileParametersT kDrive = MakeProfileParameters(2.0, 4.0);
@@ -381,6 +383,11 @@
INFO, "Done backing up %lf s\n",
aos::time::DurationInSeconds(aos::monotonic_clock::now() - start_time));
+ if (!FLAGS_do_balance) {
+ StopSpitting();
+ return;
+ }
+
const ProfileParametersT kInPlaceTurn = MakeProfileParameters(2.7, 8.0);
StartDrive(0.0, aos::math::NormalizeAngle(M_PI / 2.0 - Theta()), kDrive,
kInPlaceTurn);