Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 1 | #include "absl/flags/flag.h" |
| 2 | |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 3 | #include "aos/events/shm_event_loop.h" |
| 4 | #include "aos/init.h" |
| 5 | #include "y2023/control_loops/superstructure/superstructure.h" |
| 6 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 7 | ABSL_FLAG(std::string, arm_trajectories, "arm_trajectories_generated.bfbs", |
| 8 | "The path to the generated arm trajectories bfbs file."); |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 9 | |
| 10 | using y2023::control_loops::superstructure::Superstructure; |
| 11 | using y2023::control_loops::superstructure::arm::ArmTrajectories; |
| 12 | |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 13 | int 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 Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 20 | |
Ravago Jones | 8c65c43 | 2023-03-25 17:35:39 -0700 | [diff] [blame] | 21 | frc971::constants::WaitForConstants<y2023::Constants>(&config.message()); |
| 22 | |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 23 | auto trajectories = |
| 24 | y2023::control_loops::superstructure::Superstructure::GetArmTrajectories( |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 25 | absl::GetFlag(FLAGS_arm_trajectories)); |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 26 | |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 27 | std::shared_ptr<const y2023::constants::Values> values = |
| 28 | std::make_shared<const y2023::constants::Values>( |
| 29 | y2023::constants::MakeValues()); |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 30 | Superstructure superstructure(&event_loop, values, trajectories); |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 31 | |
| 32 | event_loop.Run(); |
| 33 | |
| 34 | return 0; |
| 35 | } |