Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -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" |
James Kuszmaul | 04a343c | 2023-02-20 16:38:22 -0800 | [diff] [blame] | 6 | #include "frc971/control_loops/drivetrain/localization/puppet_localizer.h" |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 7 | #include "y2023/control_loops/drivetrain/drivetrain_base.h" |
James Kuszmaul | c29f457 | 2023-02-25 17:02:33 -0800 | [diff] [blame^] | 8 | #include "y2023/control_loops/drivetrain/target_selector.h" |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 9 | |
| 10 | using ::frc971::control_loops::drivetrain::DrivetrainLoop; |
| 11 | |
| 12 | int main(int argc, char **argv) { |
| 13 | aos::InitGoogle(&argc, &argv); |
| 14 | |
| 15 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
| 16 | aos::configuration::ReadConfig("aos_config.json"); |
| 17 | |
| 18 | aos::ShmEventLoop event_loop(&config.message()); |
James Kuszmaul | 04a343c | 2023-02-20 16:38:22 -0800 | [diff] [blame] | 19 | std::unique_ptr<::frc971::control_loops::drivetrain::PuppetLocalizer> |
| 20 | localizer = std::make_unique< |
| 21 | ::frc971::control_loops::drivetrain::PuppetLocalizer>( |
| 22 | &event_loop, |
James Kuszmaul | c29f457 | 2023-02-25 17:02:33 -0800 | [diff] [blame^] | 23 | ::y2023::control_loops::drivetrain::GetDrivetrainConfig(), |
| 24 | std::make_unique<::y2023::control_loops::drivetrain::TargetSelector>( |
| 25 | &event_loop)); |
Ravago Jones | 2060ee6 | 2023-02-03 18:12:24 -0800 | [diff] [blame] | 26 | std::unique_ptr<DrivetrainLoop> drivetrain = std::make_unique<DrivetrainLoop>( |
| 27 | y2023::control_loops::drivetrain::GetDrivetrainConfig(), &event_loop, |
| 28 | localizer.get()); |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 29 | |
| 30 | event_loop.Run(); |
| 31 | |
| 32 | return 0; |
| 33 | } |