blob: 4f85551f5d02795cb6f8be8b0b0b425301a81653 [file] [log] [blame]
Austin Schuh99f7c6a2024-06-25 22:07:44 -07001#include "absl/flags/flag.h"
2
Maxwell Hendersonc3d063a2023-12-26 17:37:22 -08003#include "aos/events/shm_event_loop.h"
4#include "aos/init.h"
5#include "aos/realtime.h"
6#include "frc971/imu_reader/imu.h"
7#include "y2024_defense/constants.h"
8
Austin Schuh99f7c6a2024-06-25 22:07:44 -07009ABSL_FLAG(std::string, config, "aos_config.json",
10 "Path to the config file to use.");
Maxwell Hendersonc3d063a2023-12-26 17:37:22 -080011
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 Hendersonc3d063a2023-12-26 17:37:22 -080017
18 aos::ShmEventLoop event_loop(&config.message());
19 frc971::imu::Imu imu(
20 &event_loop,
21 y2024_defense::constants::Values::DrivetrainEncoderToMeters(1));
22
23 event_loop.SetRuntimeAffinity(aos::MakeCpusetFromCpus({0}));
24 event_loop.SetRuntimeRealtimePriority(55);
25
26 event_loop.Run();
27
28 return 0;
29}