2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
swappable_controllers_subsystem.h
Go to the documentation of this file.
1
4
5#pragma once
6
7#include <frc2/command/SubsystemBase.h>
8
10
11namespace argos_lib {
12
18 class SwappableControllersSubsystem : public frc2::SubsystemBase {
19 public:
27 SwappableControllersSubsystem(int driverControllerPort, int operatorControllerPort);
28
32 void Swap();
33
46
50 void Periodic() override;
51
56
57 private:
60 bool m_swapped;
61
65 void UpdateVibration();
66 };
67
68} // namespace argos_lib
Allows two controllers to swap between "Driver" and "Operator" control schemes on the fly by swapping...
Definition swappable_controllers_subsystem.h:18
void Swap()
Swap driver and operator controller rolls.
Definition swappable_controllers_subsystem.cpp:12
bool m_swapped
Indicates if controllers are currently swapped.
Definition swappable_controllers_subsystem.h:60
argos_lib::XboxController & OperatorController()
Get reference to active operator controller.
Definition swappable_controllers_subsystem.cpp:20
argos_lib::XboxController m_driverController
Managed driver controller.
Definition swappable_controllers_subsystem.h:58
void UpdateVibration()
Update vibration on both controllers based on their active vibration models.
Definition swappable_controllers_subsystem.cpp:36
void Periodic() override
Will be called periodically whenever the CommandScheduler runs.
Definition swappable_controllers_subsystem.cpp:27
argos_lib::XboxController & DriverController()
Get reference to active driver controller.
Definition swappable_controllers_subsystem.cpp:17
void VibrateAll(argos_lib::VibrationModel newModel)
Change vibration model for both controllers.
Definition swappable_controllers_subsystem.cpp:31
argos_lib::XboxController m_operatorController
Managed operator controller.
Definition swappable_controllers_subsystem.h:59
Definition xbox_controller.h:18
Definition swap_controllers_command.h:12
std::function< VibrationStatus()> VibrationModel
Definition vibration.h:21