2022-Robot
Robot code for 2022 FRC Season by Argos, FRC team #1756
Loading...
Searching...
No Matches
argos_lib::SwappableControllersSubsystem Class Reference

Allows two controllers to swap between "Driver" and "Operator" control schemes on the fly by swapping the m_driverController and m_operatorController objects. More...

#include <swappable_controllers_subsystem.h>

Inheritance diagram for argos_lib::SwappableControllersSubsystem:

Public Member Functions

 SwappableControllersSubsystem ()=delete
 
 SwappableControllersSubsystem (int driverControllerPort, int operatorControllerPort)
 Construct a new Swappable Controllers Subsystem object with two controllers. More...
 
void Swap ()
 Swap driver and operator controller rolls. More...
 
argos_lib::XboxControllerDriverController ()
 Get reference to active driver controller. More...
 
argos_lib::XboxControllerOperatorController ()
 Get reference to active operator controller. More...
 
void Periodic () override
 Will be called periodically whenever the CommandScheduler runs. More...
 
void VibrateAll (argos_lib::VibrationModel newModel)
 Change vibration model for both controllers. More...
 

Private Member Functions

void UpdateVibration ()
 Update vibration on both controllers based on their active vibration models. More...
 

Private Attributes

argos_lib::XboxController m_driverController
 Managed driver controller. More...
 
argos_lib::XboxController m_operatorController
 Managed operator controller. More...
 
bool m_swapped
 Indicates if controllers are currently swapped. More...
 

Detailed Description

Allows two controllers to swap between "Driver" and "Operator" control schemes on the fly by swapping the m_driverController and m_operatorController objects.

Constructor & Destructor Documentation

◆ SwappableControllersSubsystem() [1/2]

argos_lib::SwappableControllersSubsystem::SwappableControllersSubsystem ( )
delete

◆ SwappableControllersSubsystem() [2/2]

SwappableControllersSubsystem::SwappableControllersSubsystem ( int  driverControllerPort,
int  operatorControllerPort 
)

Construct a new Swappable Controllers Subsystem object with two controllers.

Parameters
driverControllerPortIndex of driver controller
operatorControllerPortIndex of operator controller

Member Function Documentation

◆ DriverController()

XboxController & SwappableControllersSubsystem::DriverController ( )

Get reference to active driver controller.

Returns
Active driver controller based on swaps up to this point

◆ OperatorController()

XboxController & SwappableControllersSubsystem::OperatorController ( )

Get reference to active operator controller.

Returns
Active operator controller based on swaps up to this point

◆ Periodic()

void SwappableControllersSubsystem::Periodic ( )
override

Will be called periodically whenever the CommandScheduler runs.

Will be called periodically whenever the CommandScheduler runs.

◆ Swap()

void SwappableControllersSubsystem::Swap ( )

Swap driver and operator controller rolls.

◆ UpdateVibration()

void SwappableControllersSubsystem::UpdateVibration ( )
private

Update vibration on both controllers based on their active vibration models.

◆ VibrateAll()

void SwappableControllersSubsystem::VibrateAll ( argos_lib::VibrationModel  newModel)

Change vibration model for both controllers.

Member Data Documentation

◆ m_driverController

argos_lib::XboxController argos_lib::SwappableControllersSubsystem::m_driverController
private

Managed driver controller.

◆ m_operatorController

argos_lib::XboxController argos_lib::SwappableControllersSubsystem::m_operatorController
private

Managed operator controller.

◆ m_swapped

bool argos_lib::SwappableControllersSubsystem::m_swapped
private

Indicates if controllers are currently swapped.


The documentation for this class was generated from the following files: