Austin Schuh | 2ca00ec | 2021-06-20 14:51:25 -0700 | [diff] [blame] | 1 | #include <memory> |
| 2 | |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 3 | #include "aos/events/shm_event_loop.h" |
| 4 | #include "aos/init.h" |
| 5 | #include "frc971/control_loops/drivetrain/drivetrain.h" |
| 6 | #include "y2020/control_loops/drivetrain/drivetrain_base.h" |
James Kuszmaul | 68f7d27 | 2020-02-22 20:55:02 -0800 | [diff] [blame] | 7 | #include "y2020/control_loops/drivetrain/localizer.h" |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 8 | |
| 9 | using ::frc971::control_loops::drivetrain::DrivetrainLoop; |
| 10 | |
James Kuszmaul | 2d8fa2a | 2020-03-01 13:51:50 -0800 | [diff] [blame] | 11 | int main(int argc, char *argv[]) { |
| 12 | ::aos::InitGoogle(&argc, &argv); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 13 | |
| 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"); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 16 | |
| 17 | ::aos::ShmEventLoop event_loop(&config.message()); |
Austin Schuh | 6e66059 | 2021-10-17 17:37:33 -0700 | [diff] [blame] | 18 | std::unique_ptr<::y2020::control_loops::drivetrain::Localizer> localizer = |
| 19 | std::make_unique<y2020::control_loops::drivetrain::Localizer>( |
| 20 | &event_loop, |
| 21 | ::y2020::control_loops::drivetrain::GetDrivetrainConfig()); |
Austin Schuh | 2ca00ec | 2021-06-20 14:51:25 -0700 | [diff] [blame] | 22 | std::unique_ptr<DrivetrainLoop> drivetrain = std::make_unique<DrivetrainLoop>( |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 23 | ::y2020::control_loops::drivetrain::GetDrivetrainConfig(), &event_loop, |
Austin Schuh | 6e66059 | 2021-10-17 17:37:33 -0700 | [diff] [blame] | 24 | localizer.get()); |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 25 | |
| 26 | event_loop.Run(); |
| 27 | |
Stephan Massalt | d021f97 | 2020-01-05 20:41:23 -0800 | [diff] [blame] | 28 | return 0; |
| 29 | } |