Austin Schuh | 2ca00ec | 2021-06-20 14:51:25 -0700 | [diff] [blame] | 1 | #include <memory> |
Austin Schuh | 378483c | 2019-01-20 16:36:40 -0800 | [diff] [blame] | 2 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 3 | #include "aos/events/shm_event_loop.h" |
Austin Schuh | 2ca00ec | 2021-06-20 14:51:25 -0700 | [diff] [blame] | 4 | #include "aos/init.h" |
Austin Schuh | 378483c | 2019-01-20 16:36:40 -0800 | [diff] [blame] | 5 | #include "frc971/control_loops/drivetrain/drivetrain.h" |
| 6 | #include "y2019/control_loops/drivetrain/drivetrain_base.h" |
James Kuszmaul | 09f564a | 2019-02-18 17:37:09 -0800 | [diff] [blame] | 7 | #include "y2019/control_loops/drivetrain/event_loop_localizer.h" |
Austin Schuh | 378483c | 2019-01-20 16:36:40 -0800 | [diff] [blame] | 8 | |
| 9 | using ::frc971::control_loops::drivetrain::DrivetrainLoop; |
| 10 | |
Austin Schuh | 094d09b | 2020-11-20 23:26:52 -0800 | [diff] [blame] | 11 | int main(int argc, char **argv) { |
| 12 | ::aos::InitGoogle(&argc, &argv); |
Austin Schuh | 9fe68f7 | 2019-08-10 19:32:03 -0700 | [diff] [blame] | 13 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 14 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
Austin Schuh | c5fa6d9 | 2022-02-25 14:36:28 -0800 | [diff] [blame^] | 15 | aos::configuration::ReadConfig("aos_config.json"); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 16 | |
| 17 | ::aos::ShmEventLoop event_loop(&config.message()); |
James Kuszmaul | 09f564a | 2019-02-18 17:37:09 -0800 | [diff] [blame] | 18 | ::y2019::control_loops::drivetrain::EventLoopLocalizer localizer( |
Austin Schuh | 9fe68f7 | 2019-08-10 19:32:03 -0700 | [diff] [blame] | 19 | &event_loop, ::y2019::control_loops::drivetrain::GetDrivetrainConfig()); |
Austin Schuh | 2ca00ec | 2021-06-20 14:51:25 -0700 | [diff] [blame] | 20 | std::unique_ptr<DrivetrainLoop> drivetrain = std::make_unique<DrivetrainLoop>( |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 21 | ::y2019::control_loops::drivetrain::GetDrivetrainConfig(), &event_loop, |
| 22 | &localizer); |
Austin Schuh | 9fe68f7 | 2019-08-10 19:32:03 -0700 | [diff] [blame] | 23 | |
| 24 | event_loop.Run(); |
| 25 | |
Austin Schuh | 378483c | 2019-01-20 16:36:40 -0800 | [diff] [blame] | 26 | return 0; |
| 27 | } |