blob: 4a044b6b129e7368554b529f8bdf349229e4f9d4 [file] [log] [blame]
Maxwell Hendersonad312342023-01-10 12:07:47 -08001#include "aos/events/shm_event_loop.h"
2#include "aos/init.h"
3#include "y2023/control_loops/superstructure/superstructure.h"
4
Maxwell Hendersonb392b742023-03-05 07:53:51 -08005DEFINE_string(arm_trajectories, "arm_trajectories_generated.bfbs",
6 "The path to the generated arm trajectories bfbs file.");
7
8using y2023::control_loops::superstructure::Superstructure;
9using y2023::control_loops::superstructure::arm::ArmTrajectories;
10
Maxwell Hendersonad312342023-01-10 12:07:47 -080011int 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 Hendersonb392b742023-03-05 07:53:51 -080018
Ravago Jones8c65c432023-03-25 17:35:39 -070019 frc971::constants::WaitForConstants<y2023::Constants>(&config.message());
20
Maxwell Hendersonb392b742023-03-05 07:53:51 -080021 auto trajectories =
22 y2023::control_loops::superstructure::Superstructure::GetArmTrajectories(
23 FLAGS_arm_trajectories);
24
Maxwell Hendersonad312342023-01-10 12:07:47 -080025 std::shared_ptr<const y2023::constants::Values> values =
26 std::make_shared<const y2023::constants::Values>(
27 y2023::constants::MakeValues());
Maxwell Hendersonb392b742023-03-05 07:53:51 -080028 Superstructure superstructure(&event_loop, values, trajectories);
Maxwell Hendersonad312342023-01-10 12:07:47 -080029
30 event_loop.Run();
31
32 return 0;
33}