blob: 0a2f99a258760c89a47beda384947344eaabfe18 [file] [log] [blame]
Comran Morshed0d6cf9b2015-06-17 19:29:57 +00001#include <stdio.h>
2
3#include <memory>
4
5#include "aos/common/util/phased_loop.h"
6#include "aos/common/time.h"
7#include "aos/common/util/trapezoid_profile.h"
8#include "aos/common/logging/logging.h"
9#include "aos/common/logging/queue_logging.h"
10
11#include "bot3/autonomous/auto.q.h"
12#include "bot3/control_loops/drivetrain/drivetrain.q.h"
13#include "frc971/actors/drivetrain_actor.h"
14
15using ::aos::time::Time;
16using ::bot3::control_loops::drivetrain_queue;
17
18namespace bot3 {
19namespace autonomous {
20
21struct ProfileParams {
22 double velocity;
23 double acceleration;
24};
25
26namespace time = ::aos::time;
27
28bool ShouldExitAuto() {
29 ::bot3::autonomous::autonomous.FetchLatest();
30 bool ans = !::bot3::autonomous::autonomous->run_auto;
31 if (ans) {
32 LOG(INFO, "Time to exit auto mode\n");
33 }
34 return ans;
35}
36
37void HandleAuto() {
38 ::aos::time::Time start_time = ::aos::time::Time::Now();
39 LOG(INFO, "Starting auto mode at %f\n", start_time.ToSeconds());
40 ::std::unique_ptr<::frc971::actors::DrivetrainAction> drive;
41 LOG(INFO, "Doing nothing in auto.\n");
42
43 if (ShouldExitAuto()) return;
44}
45
46} // namespace autonomous
47} // namespace bot3