blob: 5409da301b9f63c1edd7ca3b140001b7045a78c0 [file] [log] [blame]
Maxwell Hendersonf63a0d92023-06-24 14:49:51 -07001#include "aos/events/shm_event_loop.h"
Nikolai Sohmers3cc1fc22024-05-04 12:27:58 -07002#include "y2024_swerve/swerve_publisher_lib.h"
Maxwell Hendersonf63a0d92023-06-24 14:49:51 -07003
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
Nikolai Sohmers3cc1fc22024-05-04 12:27:58 -070019 y2024_swerve::SwervePublisher publisher(&event_loop, exit_handle.get(),
20 FLAGS_drivetrain_position,
21 FLAGS_duration);
Maxwell Hendersonf63a0d92023-06-24 14:49:51 -070022
23 event_loop.Run();
24}