blob: da7a99f4b15013b051494d3d6344e24db6707627 [file] [log] [blame]
Austin Schuh99f7c6a2024-06-25 22:07:44 -07001#include "absl/flags/flag.h"
2
Maxwell Hendersonf63a0d92023-06-24 14:49:51 -07003#include "aos/events/shm_event_loop.h"
Nikolai Sohmers3cc1fc22024-05-04 12:27:58 -07004#include "y2024_swerve/swerve_publisher_lib.h"
Maxwell Hendersonf63a0d92023-06-24 14:49:51 -07005
Austin Schuh99f7c6a2024-06-25 22:07:44 -07006ABSL_FLAG(double, duration, 100.0, "Length of time in Ms to apply current for");
7ABSL_FLAG(std::string, drivetrain_position, "swerve_drivetrain_output.json",
8 "The path to the json drivetrain position to apply");
9ABSL_FLAG(std::string, config, "aos_config.json",
10 "The path to aos_config.json");
Maxwell Hendersonf63a0d92023-06-24 14:49:51 -070011
12int main(int argc, char **argv) {
13 aos::InitGoogle(&argc, &argv);
14
15 aos::FlatbufferDetachedBuffer<aos::Configuration> config =
Austin Schuh99f7c6a2024-06-25 22:07:44 -070016 aos::configuration::ReadConfig(absl::GetFlag(FLAGS_config));
Maxwell Hendersonf63a0d92023-06-24 14:49:51 -070017
18 aos::ShmEventLoop event_loop(&config.message());
19
20 std::unique_ptr<aos::ExitHandle> exit_handle = event_loop.MakeExitHandle();
21
Austin Schuh99f7c6a2024-06-25 22:07:44 -070022 y2024_swerve::SwervePublisher publisher(
23 &event_loop, exit_handle.get(), absl::GetFlag(FLAGS_drivetrain_position),
24 absl::GetFlag(FLAGS_duration));
Maxwell Hendersonf63a0d92023-06-24 14:49:51 -070025
26 event_loop.Run();
27}