blob: 091d992d99d3df32be37e06dbe6895094dfd2d8c [file] [log] [blame]
Brian Silverman17f503e2015-08-02 18:17:18 -07001#include "aos/common/controls/replay_control_loop.h"
2#include "aos/linux_code/init.h"
3
4#include "y2014/control_loops/drivetrain/drivetrain.q.h"
Austin Schuhd0e02df2015-11-26 12:48:51 -08005#include "frc971/queues/gyro.q.h"
Brian Silverman17f503e2015-08-02 18:17:18 -07006
7// Reads one or more log files and sends out all the queue messages (in the
8// correct order and at the correct time) to feed a "live" drivetrain process.
9
10int main(int argc, char **argv) {
11 if (argc <= 1) {
12 fprintf(stderr, "Need at least one file to replay!\n");
13 return EXIT_FAILURE;
14 }
15
16 ::aos::InitNRT();
17
18 ::aos::controls::ControlLoopReplayer<::frc971::control_loops::DrivetrainQueue>
19 replayer(&::frc971::control_loops::drivetrain_queue, "drivetrain");
Austin Schuhd0e02df2015-11-26 12:48:51 -080020
21 replayer.AddDirectQueueSender("wpilib_interface.Gyro", "sending",
22 ::frc971::sensors::gyro_reading);
Brian Silverman17f503e2015-08-02 18:17:18 -070023 for (int i = 1; i < argc; ++i) {
24 replayer.ProcessFile(argv[i]);
25 }
26
27 ::aos::Cleanup();
28}