Nikolai Sohmers | 0991b1f | 2024-10-20 14:24:34 -0700 | [diff] [blame^] | 1 | #include "frc971/input/swerve_joystick_input.h" |
| 2 | |
| 3 | #include "frc971/input/driver_station_data.h" |
| 4 | #include "frc971/input/redundant_joystick_data.h" |
| 5 | |
| 6 | using frc971::input::driver_station::ControlBit; |
| 7 | |
| 8 | namespace frc971::input { |
| 9 | |
| 10 | void SwerveJoystickInput::RunIteration( |
| 11 | const ::frc971::input::driver_station::Data &unsorted_data) { |
| 12 | if (input_config_.use_redundant_joysticks) { |
| 13 | driver_station::RedundantData redundant_data_storage(unsorted_data); |
| 14 | DoRunIteration(redundant_data_storage); |
| 15 | } else { |
| 16 | DoRunIteration(unsorted_data); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | void SwerveJoystickInput::DoRunIteration( |
| 21 | const ::frc971::input::driver_station::Data &data) { |
| 22 | drivetrain_input_reader_->HandleDrivetrain(data); |
| 23 | HandleTeleop(data); |
| 24 | action_queue_.Tick(); |
| 25 | was_running_ = action_queue_.Running(); |
| 26 | } |
| 27 | |
| 28 | } // namespace frc971::input |