John Park | 398c74a | 2018-10-20 21:17:39 -0700 | [diff] [blame] | 1 | #include "aos/init.h" |
Brian Silverman | c71537c | 2016-01-01 13:43:14 -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 | 2a671df | 2016-11-26 15:00:06 -0800 | [diff] [blame] | 4 | #include "frc971/control_loops/drivetrain/drivetrain.h" |
| 5 | #include "y2012/control_loops/drivetrain/drivetrain_base.h" |
| 6 | |
| 7 | using ::frc971::control_loops::drivetrain::DrivetrainLoop; |
| 8 | |
Brian Silverman | c71537c | 2016-01-01 13:43:14 -0800 | [diff] [blame] | 9 | int main() { |
James Kuszmaul | ad8a808 | 2020-02-14 21:21:58 -0800 | [diff] [blame] | 10 | ::aos::InitNRT(); |
Austin Schuh | 9fe68f7 | 2019-08-10 19:32:03 -0700 | [diff] [blame] | 11 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 12 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
| 13 | aos::configuration::ReadConfig("config.json"); |
| 14 | |
| 15 | ::aos::ShmEventLoop event_loop(&config.message()); |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 16 | ::frc971::control_loops::drivetrain::DeadReckonEkf localizer( |
Austin Schuh | 9fe68f7 | 2019-08-10 19:32:03 -0700 | [diff] [blame] | 17 | &event_loop, ::y2012::control_loops::drivetrain::GetDrivetrainConfig()); |
Austin Schuh | 2a671df | 2016-11-26 15:00:06 -0800 | [diff] [blame] | 18 | DrivetrainLoop drivetrain( |
James Kuszmaul | 3431d62 | 2019-02-17 17:07:44 -0800 | [diff] [blame] | 19 | ::y2012::control_loops::drivetrain::GetDrivetrainConfig(), &event_loop, |
| 20 | &localizer); |
Austin Schuh | 9fe68f7 | 2019-08-10 19:32:03 -0700 | [diff] [blame] | 21 | |
| 22 | event_loop.Run(); |
| 23 | |
Brian Silverman | c71537c | 2016-01-01 13:43:14 -0800 | [diff] [blame] | 24 | ::aos::Cleanup(); |
| 25 | return 0; |
| 26 | } |