blob: fbd7f019e58b9ba4e8d3780fb3b5097c89eb49cd [file] [log] [blame]
Nikolai Sohmers0991b1f2024-10-20 14:24:34 -07001#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
6using frc971::input::driver_station::ControlBit;
7
8namespace frc971::input {
9
10void 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
20void 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