Austin Schuh | 2ca00ec | 2021-06-20 14:51:25 -0700 | [diff] [blame^] | 1 | #include <memory> |
Comran Morshed | 9a9948c | 2016-01-16 15:58:04 +0000 | [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" |
Comran Morshed | 9a9948c | 2016-01-16 15:58:04 +0000 | [diff] [blame] | 5 | #include "frc971/control_loops/drivetrain/drivetrain.h" |
Comran Morshed | 6c6a0a9 | 2016-01-17 12:45:16 +0000 | [diff] [blame] | 6 | #include "y2016/control_loops/drivetrain/drivetrain_base.h" |
Comran Morshed | 9a9948c | 2016-01-16 15:58:04 +0000 | [diff] [blame] | 7 | |
| 8 | using ::frc971::control_loops::drivetrain::DrivetrainLoop; |
| 9 | |
Austin Schuh | 094d09b | 2020-11-20 23:26:52 -0800 | [diff] [blame] | 10 | int main(int argc, char **argv) { |
| 11 | ::aos::InitGoogle(&argc, &argv); |
Austin Schuh | 9fe68f7 | 2019-08-10 19:32:03 -0700 | [diff] [blame] | 12 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 13 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
| 14 | aos::configuration::ReadConfig("config.json"); |
| 15 | |
| 16 | ::aos::ShmEventLoop event_loop(&config.message()); |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 17 | ::frc971::control_loops::drivetrain::DeadReckonEkf localizer( |
Austin Schuh | 9fe68f7 | 2019-08-10 19:32:03 -0700 | [diff] [blame] | 18 | &event_loop, ::y2016::control_loops::drivetrain::GetDrivetrainConfig()); |
Austin Schuh | 2ca00ec | 2021-06-20 14:51:25 -0700 | [diff] [blame^] | 19 | std::unique_ptr<DrivetrainLoop> drivetrain = std::make_unique<DrivetrainLoop>( |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 20 | ::y2016::control_loops::drivetrain::GetDrivetrainConfig(), &event_loop, |
| 21 | &localizer); |
Austin Schuh | 9fe68f7 | 2019-08-10 19:32:03 -0700 | [diff] [blame] | 22 | |
| 23 | event_loop.Run(); |
| 24 | |
Comran Morshed | 9a9948c | 2016-01-16 15:58:04 +0000 | [diff] [blame] | 25 | return 0; |
| 26 | } |