blob: 74f102087e2f376f958a9deed6c7e19cddf9d788 [file] [log] [blame]
Austin Schuh99f7c6a2024-06-25 22:07:44 -07001#include "absl/flags/flag.h"
2#include "absl/log/check.h"
3#include "absl/log/log.h"
Yash Maheshwarie0b25c52024-05-22 20:23:36 -07004
5#include "aos/configuration.h"
6#include "aos/events/shm_event_loop.h"
7#include "aos/init.h"
8#include "aos/json_to_flatbuffer.h"
9#include "frc971/constants/constants_sender_lib.h"
10#include "y2024_swerve/constants/constants_generated.h"
11#include "y2024_swerve/constants/constants_list_generated.h"
12
Austin Schuh99f7c6a2024-06-25 22:07:44 -070013ABSL_FLAG(std::string, config, "aos_config.json", "Path to the AOS config.");
14ABSL_FLAG(std::string, constants_path, "constants.json",
15 "Path to the constant file");
Yash Maheshwarie0b25c52024-05-22 20:23:36 -070016
17int main(int argc, char **argv) {
18 aos::InitGoogle(&argc, &argv);
19 aos::FlatbufferDetachedBuffer<aos::Configuration> config =
Austin Schuh99f7c6a2024-06-25 22:07:44 -070020 aos::configuration::ReadConfig(absl::GetFlag(FLAGS_config));
Yash Maheshwarie0b25c52024-05-22 20:23:36 -070021 aos::ShmEventLoop event_loop(&config.message());
22 frc971::constants::ConstantSender<y2024_swerve::Constants,
23 y2024_swerve::ConstantsList>
Austin Schuh99f7c6a2024-06-25 22:07:44 -070024 constants_sender(&event_loop, absl::GetFlag(FLAGS_constants_path));
Yash Maheshwarie0b25c52024-05-22 20:23:36 -070025 // Don't need to call Run().
26 return 0;
27}