Nikolai Sohmers | 0991b1f | 2024-10-20 14:24:34 -0700 | [diff] [blame] | 1 | #include <unistd.h> |
| 2 | |
| 3 | #include <cmath> |
| 4 | #include <cstdio> |
| 5 | #include <cstring> |
| 6 | |
| 7 | #include "absl/flags/flag.h" |
| 8 | |
| 9 | #include "aos/actions/actions.h" |
| 10 | #include "aos/events/event_loop.h" |
| 11 | #include "aos/events/shm_event_loop.h" |
| 12 | #include "aos/init.h" |
| 13 | #include "aos/logging/logging.h" |
| 14 | #include "aos/network/team_number.h" |
| 15 | #include "aos/util/log_interval.h" |
| 16 | #include "frc971/input/driver_station_data.h" |
| 17 | #include "frc971/input/drivetrain_input.h" |
| 18 | #include "frc971/input/joystick_input.h" |
| 19 | #include "frc971/input/redundant_joystick_data.h" |
| 20 | #include "frc971/input/swerve_joystick_input.h" |
| 21 | |
| 22 | using frc971::CreateProfileParameters; |
| 23 | using frc971::input::driver_station::ButtonLocation; |
| 24 | using frc971::input::driver_station::ControlBit; |
| 25 | using frc971::input::driver_station::JoystickAxis; |
| 26 | using frc971::input::driver_station::POVLocation; |
| 27 | using Side = frc971::control_loops::drivetrain::RobotSide; |
| 28 | |
| 29 | namespace y2024_swerve::input::joysticks { |
| 30 | |
| 31 | namespace swerve = frc971::control_loops::swerve; |
| 32 | |
| 33 | class Reader : public ::frc971::input::SwerveJoystickInput { |
| 34 | public: |
| 35 | Reader(::aos::EventLoop *event_loop) |
| 36 | : ::frc971::input::SwerveJoystickInput( |
| 37 | event_loop, {.use_redundant_joysticks = true}) {} |
| 38 | |
| 39 | void HandleTeleop( |
| 40 | const ::frc971::input::driver_station::Data &data) override { |
| 41 | // Where teleop logic will eventually go when there is superstructure code |
| 42 | (void)data; |
| 43 | } |
| 44 | }; |
| 45 | |
| 46 | } // namespace y2024_swerve::input::joysticks |
| 47 | |
| 48 | int main(int argc, char **argv) { |
| 49 | ::aos::InitGoogle(&argc, &argv); |
| 50 | |
| 51 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
| 52 | aos::configuration::ReadConfig("aos_config.json"); |
| 53 | |
| 54 | ::aos::ShmEventLoop event_loop(&config.message()); |
| 55 | ::y2024_swerve::input::joysticks::Reader reader(&event_loop); |
| 56 | |
| 57 | event_loop.Run(); |
| 58 | |
| 59 | return 0; |
| 60 | } |