Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 1 | #include "aos/events/shm_event_loop.h" |
| 2 | #include "aos/init.h" |
| 3 | #include "y2023/control_loops/superstructure/superstructure.h" |
| 4 | |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 5 | DEFINE_string(arm_trajectories, "arm_trajectories_generated.bfbs", |
| 6 | "The path to the generated arm trajectories bfbs file."); |
| 7 | |
| 8 | using y2023::control_loops::superstructure::Superstructure; |
| 9 | using y2023::control_loops::superstructure::arm::ArmTrajectories; |
| 10 | |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 11 | int main(int argc, char **argv) { |
| 12 | ::aos::InitGoogle(&argc, &argv); |
| 13 | |
| 14 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
| 15 | aos::configuration::ReadConfig("aos_config.json"); |
| 16 | |
| 17 | ::aos::ShmEventLoop event_loop(&config.message()); |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 18 | |
Ravago Jones | 8c65c43 | 2023-03-25 17:35:39 -0700 | [diff] [blame] | 19 | frc971::constants::WaitForConstants<y2023::Constants>(&config.message()); |
| 20 | |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 21 | auto trajectories = |
| 22 | y2023::control_loops::superstructure::Superstructure::GetArmTrajectories( |
| 23 | FLAGS_arm_trajectories); |
| 24 | |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 25 | std::shared_ptr<const y2023::constants::Values> values = |
| 26 | std::make_shared<const y2023::constants::Values>( |
| 27 | y2023::constants::MakeValues()); |
Maxwell Henderson | b392b74 | 2023-03-05 07:53:51 -0800 | [diff] [blame] | 28 | Superstructure superstructure(&event_loop, values, trajectories); |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 29 | |
| 30 | event_loop.Run(); |
| 31 | |
| 32 | return 0; |
| 33 | } |