Brian Silverman | 17f503e | 2015-08-02 18:17:18 -0700 | [diff] [blame] | 1 | #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 Schuh | d0e02df | 2015-11-26 12:48:51 -0800 | [diff] [blame^] | 5 | #include "frc971/queues/gyro.q.h" |
Brian Silverman | 17f503e | 2015-08-02 18:17:18 -0700 | [diff] [blame] | 6 | |
| 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 | |
| 10 | int 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 Schuh | d0e02df | 2015-11-26 12:48:51 -0800 | [diff] [blame^] | 20 | |
| 21 | replayer.AddDirectQueueSender("wpilib_interface.Gyro", "sending", |
| 22 | ::frc971::sensors::gyro_reading); |
Brian Silverman | 17f503e | 2015-08-02 18:17:18 -0700 | [diff] [blame] | 23 | for (int i = 1; i < argc; ++i) { |
| 24 | replayer.ProcessFile(argv[i]); |
| 25 | } |
| 26 | |
| 27 | ::aos::Cleanup(); |
| 28 | } |