blob: 87470d7416c492fde66d619692c59b2179737380 [file] [log] [blame]
Maxwell Hendersonf63a0d92023-06-24 14:49:51 -07001#include "aos/events/shm_event_loop.h"
2#include "y2023_bot4/swerve_publisher_lib.h"
3
4DEFINE_double(duration, 100.0, "Length of time in Ms to apply current for");
5DEFINE_string(drivetrain_position, "swerve_drivetrain_output.json",
6 "The path to the json drivetrain position to apply");
7DEFINE_string(config, "aos_config.json", "The path to aos_config.json");
8
9int 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}