Created actors files for autonomous and got rid of the unique autonomous folder.
Change-Id: I4b4d12070def8ed1a661b9ffd2f82f8d342b6c4b
diff --git a/y2016/joystick_reader.cc b/y2016/joystick_reader.cc
index 96586d3..d987268 100644
--- a/y2016/joystick_reader.cc
+++ b/y2016/joystick_reader.cc
@@ -20,6 +20,7 @@
#include "y2016/constants.h"
#include "frc971/queues/gyro.q.h"
#include "frc971/autonomous/auto.q.h"
+#include "y2016/actors/autonomous_actor.h"
using ::frc971::control_loops::drivetrain_queue;
using ::y2016::control_loops::shooter::shooter_queue;
@@ -289,12 +290,15 @@
private:
void StartAuto() {
LOG(INFO, "Starting auto mode\n");
- ::frc971::autonomous::autonomous.MakeWithBuilder().run_auto(true).Send();
+
+ actors::AutonomousActionParams params;
+ params.mode = 0;
+ action_queue_.EnqueueAction(actors::MakeAutonomousAction(params));
}
void StopAuto() {
LOG(INFO, "Stopping auto mode\n");
- ::frc971::autonomous::autonomous.MakeWithBuilder().run_auto(false).Send();
+ action_queue_.CancelAllActions();
}
bool is_high_gear_;