Sandstorm mode works on the left side now
Change-Id: Icec0056713929740ded78b4fe9a83f0127263a2d
diff --git a/y2019/actors/autonomous_actor.cc b/y2019/actors/autonomous_actor.cc
index 9ed3e6f..d8f7653 100644
--- a/y2019/actors/autonomous_actor.cc
+++ b/y2019/actors/autonomous_actor.cc
@@ -93,13 +93,13 @@
if (!WaitForGamePiece()) return true;
LOG(INFO, "Has game piece\n");
- StartDrive(-4.5, 0.0, kJumpDrive, kTurn);
- if (!WaitForDriveNear(3.8, 10.0)) return true;
+ StartDrive(-4.0, 0.0, kJumpDrive, kTurn);
+ if (!WaitForDriveNear(3.3, 10.0)) return true;
LOG(INFO, "Lifting\n");
set_elevator_goal(0.30);
SendSuperstructureGoal();
- if (!WaitForDriveNear(3.3, 10.0)) return true;
+ if (!WaitForDriveNear(2.8, 10.0)) return true;
LOG(INFO, "Off the platform\n");
StartDrive(0.0, 1.00, kDrive, kTurn);
@@ -107,7 +107,7 @@
if (!WaitForSuperstructureDone()) return true;
LOG(INFO, "Superstructure done\n");
- if (!WaitForDriveNear(1.2, 10.0)) return true;
+ if (!WaitForDriveNear(0.7, 10.0)) return true;
StartDrive(0.0, -0.35, kDrive, kTurn);
LOG(INFO, "Elevator up\n");
@@ -121,14 +121,6 @@
LOG(INFO, "Done %f\n", DoubleSeconds(monotonic_clock::now() - start_time));
- ::aos::time::PhasedLoop phased_loop(::std::chrono::milliseconds(5),
- ::std::chrono::milliseconds(5) / 2);
-
- while (!ShouldCancel()) {
- phased_loop.SleepUntilNext();
- }
- LOG(DEBUG, "Done running\n");
-
return true;
}
diff --git a/y2019/joystick_reader.cc b/y2019/joystick_reader.cc
index b399afa..23bc188 100644
--- a/y2019/joystick_reader.cc
+++ b/y2019/joystick_reader.cc
@@ -136,7 +136,13 @@
StringPrintf("10.%d.%d.179", team / 100, team % 100), 5000));
}
- void HandleTeleop(const ::aos::input::driver_station::Data &data) {
+ void AutoEnded() override {
+ LOG(INFO, "Auto ended, assuming disc and have piece\n");
+ grab_piece_ = true;
+ switch_ball_ = false;
+ }
+
+ void HandleTeleop(const ::aos::input::driver_station::Data &data) override {
::aos::monotonic_clock::time_point monotonic_now =
::aos::monotonic_clock::now();
superstructure_queue.position.FetchLatest();