blob: 8789fb95df94452ce57ca6182484d4cef5958c84 [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");
James Kuszmauleaba6d92024-07-31 20:42:20 -07007ABSL_FLAG(std::string, drivetrain_goal, "swerve_drivetrain_goal.json",
Austin Schuh99f7c6a2024-06-25 22:07:44 -07008 "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
James Kuszmauleaba6d92024-07-31 20:42:20 -070022 y2024_swerve::SwervePublisher publisher(&event_loop, exit_handle.get(),
23 absl::GetFlag(FLAGS_drivetrain_goal),
24 absl::GetFlag(FLAGS_duration));
Maxwell Hendersonf63a0d92023-06-24 14:49:51 -070025
26 event_loop.Run();
27}