blob: bc20e4494dec15e5fbf54ef2cf74367b45cab2c3 [file] [log] [blame]
Austin Schuh99f7c6a2024-06-25 22:07:44 -07001#include "absl/flags/flag.h"
2
Maxwell Hendersonad312342023-01-10 12:07:47 -08003#include "aos/events/shm_event_loop.h"
4#include "aos/init.h"
5#include "y2023/control_loops/superstructure/superstructure.h"
6
Austin Schuh99f7c6a2024-06-25 22:07:44 -07007ABSL_FLAG(std::string, arm_trajectories, "arm_trajectories_generated.bfbs",
8 "The path to the generated arm trajectories bfbs file.");
Maxwell Hendersonb392b742023-03-05 07:53:51 -08009
10using y2023::control_loops::superstructure::Superstructure;
11using y2023::control_loops::superstructure::arm::ArmTrajectories;
12
Maxwell Hendersonad312342023-01-10 12:07:47 -080013int main(int argc, char **argv) {
14 ::aos::InitGoogle(&argc, &argv);
15
16 aos::FlatbufferDetachedBuffer<aos::Configuration> config =
17 aos::configuration::ReadConfig("aos_config.json");
18
19 ::aos::ShmEventLoop event_loop(&config.message());
Maxwell Hendersonb392b742023-03-05 07:53:51 -080020
Ravago Jones8c65c432023-03-25 17:35:39 -070021 frc971::constants::WaitForConstants<y2023::Constants>(&config.message());
22
Maxwell Hendersonb392b742023-03-05 07:53:51 -080023 auto trajectories =
24 y2023::control_loops::superstructure::Superstructure::GetArmTrajectories(
Austin Schuh99f7c6a2024-06-25 22:07:44 -070025 absl::GetFlag(FLAGS_arm_trajectories));
Maxwell Hendersonb392b742023-03-05 07:53:51 -080026
Maxwell Hendersonad312342023-01-10 12:07:47 -080027 std::shared_ptr<const y2023::constants::Values> values =
28 std::make_shared<const y2023::constants::Values>(
29 y2023::constants::MakeValues());
Maxwell Hendersonb392b742023-03-05 07:53:51 -080030 Superstructure superstructure(&event_loop, values, trajectories);
Maxwell Hendersonad312342023-01-10 12:07:47 -080031
32 event_loop.Run();
33
34 return 0;
35}