milind-u | 086d726 | 2022-01-19 20:44:18 -0800 | [diff] [blame^] | 1 | #include <memory> |
| 2 | |
| 3 | #include "aos/events/shm_event_loop.h" |
| 4 | #include "aos/init.h" |
| 5 | #include "frc971/control_loops/drivetrain/drivetrain.h" |
| 6 | #include "y2022/control_loops/drivetrain/drivetrain_base.h" |
| 7 | |
| 8 | using ::frc971::control_loops::drivetrain::DrivetrainLoop; |
| 9 | |
| 10 | int main(int argc, char **argv) { |
| 11 | ::aos::InitGoogle(&argc, &argv); |
| 12 | |
| 13 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
| 14 | aos::configuration::ReadConfig("config.json"); |
| 15 | |
| 16 | ::aos::ShmEventLoop event_loop(&config.message()); |
| 17 | ::frc971::control_loops::drivetrain::DeadReckonEkf localizer( |
| 18 | &event_loop, |
| 19 | ::y2022::control_loops::drivetrain::GetDrivetrainConfig()); |
| 20 | std::unique_ptr<DrivetrainLoop> drivetrain = std::make_unique<DrivetrainLoop>( |
| 21 | ::y2022::control_loops::drivetrain::GetDrivetrainConfig(), |
| 22 | &event_loop, &localizer); |
| 23 | |
| 24 | event_loop.Run(); |
| 25 | |
| 26 | return 0; |
| 27 | } |