Convert y2014 to y2016, and get the drivetrain running.
I made a y2016 folder based on what was in y2014. Right now, it only has
a drivetrain control loop, and all the constants are not up to date with
the current CAD design. Changes from y2014 can be viewed by comparing to
the BASE commit, since I put this commit on top of a dummy y2014 folder
renamed y2016. Hope this helps.
Change-Id: I3f1d1d1a14a99ac441c51b2a67cbade7cbd708ab
diff --git a/y2016/autonomous/auto_main.cc b/y2016/autonomous/auto_main.cc
index bf3acf8..adf1bca 100644
--- a/y2016/autonomous/auto_main.cc
+++ b/y2016/autonomous/auto_main.cc
@@ -4,15 +4,16 @@
#include "aos/linux_code/init.h"
#include "aos/common/logging/logging.h"
#include "frc971/autonomous/auto.q.h"
-#include "y2014/autonomous/auto.h"
+#include "y2016/autonomous/auto.h"
using ::aos::time::Time;
-int main(int /*argc*/, char * /*argv*/[]) {
+int main(int /*argc*/, char * /*argv*/ []) {
::aos::Init(-1);
LOG(INFO, "Auto main started\n");
::frc971::autonomous::autonomous.FetchLatest();
+
while (!::frc971::autonomous::autonomous.get()) {
::frc971::autonomous::autonomous.FetchNextBlocking();
LOG(INFO, "Got another auto packet\n");
@@ -23,20 +24,23 @@
::frc971::autonomous::autonomous.FetchNextBlocking();
LOG(INFO, "Got another auto packet\n");
}
+
LOG(INFO, "Starting auto mode\n");
::aos::time::Time start_time = ::aos::time::Time::Now();
- ::y2014::autonomous::HandleAuto();
+ ::y2016::autonomous::HandleAuto();
::aos::time::Time elapsed_time = ::aos::time::Time::Now() - start_time;
LOG(INFO, "Auto mode exited in %f, waiting for it to finish.\n",
elapsed_time.ToSeconds());
+
while (::frc971::autonomous::autonomous->run_auto) {
::frc971::autonomous::autonomous.FetchNextBlocking();
LOG(INFO, "Got another auto packet\n");
}
+
LOG(INFO, "Waiting for auto to start back up.\n");
}
+
::aos::Cleanup();
return 0;
}
-