Maxwell Henderson | f63a0d9 | 2023-06-24 14:49:51 -0700 | [diff] [blame^] | 1 | #include "aos/events/shm_event_loop.h" |
| 2 | #include "y2023_bot4/swerve_publisher_lib.h" |
| 3 | |
| 4 | DEFINE_double(duration, 100.0, "Length of time in Ms to apply current for"); |
| 5 | DEFINE_string(drivetrain_position, "swerve_drivetrain_output.json", |
| 6 | "The path to the json drivetrain position to apply"); |
| 7 | DEFINE_string(config, "aos_config.json", "The path to aos_config.json"); |
| 8 | |
| 9 | int main(int argc, char **argv) { |
| 10 | aos::InitGoogle(&argc, &argv); |
| 11 | |
| 12 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
| 13 | aos::configuration::ReadConfig(FLAGS_config); |
| 14 | |
| 15 | aos::ShmEventLoop event_loop(&config.message()); |
| 16 | |
| 17 | std::unique_ptr<aos::ExitHandle> exit_handle = event_loop.MakeExitHandle(); |
| 18 | |
| 19 | y2023_bot4::SwervePublisher publisher(&event_loop, exit_handle.get(), |
| 20 | FLAGS_drivetrain_position, |
| 21 | FLAGS_duration); |
| 22 | |
| 23 | event_loop.Run(); |
| 24 | } |