Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 1 | #include <cstdio> |
| 2 | |
| 3 | #include "aos/events/shm_event_loop.h" |
| 4 | #include "aos/init.h" |
James Kuszmaul | b5f1183 | 2024-03-15 22:30:59 -0700 | [diff] [blame^] | 5 | #include "frc971/constants/constants_sender_lib.h" |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 6 | #include "y2024/autonomous/autonomous_actor.h" |
| 7 | |
| 8 | int main(int argc, char *argv[]) { |
| 9 | ::aos::InitGoogle(&argc, &argv); |
| 10 | |
| 11 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
| 12 | aos::configuration::ReadConfig("aos_config.json"); |
| 13 | |
James Kuszmaul | b5f1183 | 2024-03-15 22:30:59 -0700 | [diff] [blame^] | 14 | frc971::constants::WaitForConstants<y2024::Constants>(&config.message()); |
| 15 | |
| 16 | ::aos::ShmEventLoop constant_fetcher_event_loop(&config.message()); |
| 17 | frc971::constants::ConstantsFetcher<y2024::Constants> constants_fetcher( |
| 18 | &constant_fetcher_event_loop); |
| 19 | |
| 20 | const y2024::Constants *robot_constants = &constants_fetcher.constants(); |
| 21 | |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 22 | ::aos::ShmEventLoop event_loop(&config.message()); |
James Kuszmaul | b5f1183 | 2024-03-15 22:30:59 -0700 | [diff] [blame^] | 23 | ::y2024::autonomous::AutonomousActor autonomous(&event_loop, robot_constants); |
Niko Sohmers | 3860f8a | 2024-01-12 21:05:19 -0800 | [diff] [blame] | 24 | |
| 25 | event_loop.Run(); |
| 26 | |
| 27 | return 0; |
| 28 | } |