2023 Drive base
 
Loading...
Searching...
No Matches
frc.robot.subsystems.Controller Class Reference
Inheritance diagram for frc.robot.subsystems.Controller:

Public Member Functions

 Controller ()
 
double getLeftX ()
 
double getLeftY ()
 
double getRightX ()
 
double getRightY ()
 

Private Member Functions

double applyPreferences (double input, double exponent)
 

Detailed Description

Definition at line 6 of file Controller.java.

Constructor & Destructor Documentation

◆ Controller()

frc.robot.subsystems.Controller.Controller ( )

Definition at line 8 of file Controller.java.

8 {
9 super(Constants.XBOX_CONTROLLER_PORT);
10 }

References frc.robot.Constants.XBOX_CONTROLLER_PORT.

Member Function Documentation

◆ applyPreferences()

double frc.robot.subsystems.Controller.applyPreferences ( double  input,
double  exponent 
)
private

Definition at line 13 of file Controller.java.

13 {
14 if (Math.abs(input) < Constants.ANALOG_DEAD_ZONE) {
15 input = 0;
16 }
17 input = Math.pow(Math.abs(input), exponent) * Math.signum(input);
18 return input;
19 }

References frc.robot.Constants.ANALOG_DEAD_ZONE.

Referenced by frc.robot.subsystems.Controller.getLeftX(), frc.robot.subsystems.Controller.getLeftY(), frc.robot.subsystems.Controller.getRightX(), and frc.robot.subsystems.Controller.getRightY().

◆ getLeftX()

double frc.robot.subsystems.Controller.getLeftX ( )

Definition at line 23 of file Controller.java.

23 {
24 return applyPreferences(super.getLeftX(), Constants.LEFT_X_EXPONENT);
25 }
double applyPreferences(double input, double exponent)
Definition: Controller.java:13

References frc.robot.subsystems.Controller.applyPreferences(), and frc.robot.Constants.LEFT_X_EXPONENT.

Referenced by frc.robot.Robot.drive().

◆ getLeftY()

double frc.robot.subsystems.Controller.getLeftY ( )

Definition at line 29 of file Controller.java.

29 {
30 return applyPreferences(-super.getLeftY(), Constants.LEFT_Y_EXPONENT);
31 }

References frc.robot.subsystems.Controller.applyPreferences(), and frc.robot.Constants.LEFT_Y_EXPONENT.

Referenced by frc.robot.Robot.drive().

◆ getRightX()

double frc.robot.subsystems.Controller.getRightX ( )

Definition at line 34 of file Controller.java.

34 {
35 return applyPreferences(super.getRightX(), Constants.RIGHT_X_EXPONENT);
36 }

References frc.robot.subsystems.Controller.applyPreferences(), and frc.robot.Constants.RIGHT_X_EXPONENT.

Referenced by frc.robot.Robot.drive().

◆ getRightY()

double frc.robot.subsystems.Controller.getRightY ( )

Definition at line 40 of file Controller.java.

40 {
41 return applyPreferences(-super.getRightY(), Constants.RIGHT_Y_EXPONENT);
42 }

References frc.robot.subsystems.Controller.applyPreferences(), and frc.robot.Constants.RIGHT_Y_EXPONENT.


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