Package org.team1540.rooster.util
Class ChickenXboxController
- java.lang.Object
-
- edu.wpi.first.wpilibj.GenericHID
-
- edu.wpi.first.wpilibj.XboxController
-
- org.team1540.rooster.util.ChickenXboxController
-
public class ChickenXboxController extends edu.wpi.first.wpilibj.XboxController
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ChickenXboxController.Axis
static interface
ChickenXboxController.Axis2D
static class
ChickenXboxController.XboxAxis
static class
ChickenXboxController.XboxButton
-
Constructor Summary
Constructors Constructor Description ChickenXboxController(int port)
Construct an instance of a joystick.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
get2DJoystickAngle(edu.wpi.first.wpilibj.GenericHID.Hand hand)
Gets angle from a 2D joystickdouble
get2DJoystickMagnitude(edu.wpi.first.wpilibj.GenericHID.Hand hand)
org.apache.commons.math3.geometry.euclidean.twod.Vector2D
get2DJoystickVector(edu.wpi.first.wpilibj.GenericHID.Hand hand)
ChickenXboxController.Axis
getAxis(int axis)
ChickenXboxController.Axis
getAxis(ChickenXboxController.XboxAxis axis)
MultiAxisButton
getButton(double threshold, ChickenXboxController.XboxAxis... axes)
StrictDPadButton
getButton(DPadAxis button)
AxisButton
getButton(ChickenXboxController.XboxAxis axis, double threshold)
edu.wpi.first.wpilibj2.command.button.JoystickButton
getButton(ChickenXboxController.XboxButton button)
ChickenXboxController.Axis2D
getJoystick(edu.wpi.first.wpilibj.GenericHID.Hand hand)
double
getRawAxis(ChickenXboxController.XboxAxis axis)
double
getRectifiedX(edu.wpi.first.wpilibj.GenericHID.Hand hand)
Get the X axis value of the controller in the official 1540 coordinate systemChickenXboxController.Axis
getRectifiedXAxis(edu.wpi.first.wpilibj.GenericHID.Hand hand)
double
getRectifiedY(edu.wpi.first.wpilibj.GenericHID.Hand hand)
Get the Y axis value of the controller in the official 1540 coordinate systemChickenXboxController.Axis
getRectifiedYAxis(edu.wpi.first.wpilibj.GenericHID.Hand hand)
ChickenXboxController.Axis
getXAxis(edu.wpi.first.wpilibj.GenericHID.Hand hand)
ChickenXboxController.Axis
getYAxis(edu.wpi.first.wpilibj.GenericHID.Hand hand)
-
Methods inherited from class edu.wpi.first.wpilibj.XboxController
getAButton, getAButtonPressed, getAButtonReleased, getBackButton, getBackButtonPressed, getBackButtonReleased, getBButton, getBButtonPressed, getBButtonReleased, getBumper, getBumperPressed, getBumperReleased, getStartButton, getStartButtonPressed, getStartButtonReleased, getStickButton, getStickButtonPressed, getStickButtonReleased, getTriggerAxis, getX, getXButton, getXButtonPressed, getXButtonReleased, getY, getYButton, getYButtonPressed, getYButtonReleased
-
-
-
-
Method Detail
-
getRawAxis
public double getRawAxis(ChickenXboxController.XboxAxis axis)
-
getRectifiedX
public double getRectifiedX(edu.wpi.first.wpilibj.GenericHID.Hand hand)
Get the X axis value of the controller in the official 1540 coordinate system- Parameters:
hand
- Side of controller whose value should be returned.- Returns:
- The X axis value of the controller in the official 1540 coordinate system
-
getRectifiedY
public double getRectifiedY(edu.wpi.first.wpilibj.GenericHID.Hand hand)
Get the Y axis value of the controller in the official 1540 coordinate system- Parameters:
hand
- Side of controller whose value should be returned.- Returns:
- The Y axis value of the controller in the official 1540 coordinate system
-
get2DJoystickVector
public org.apache.commons.math3.geometry.euclidean.twod.Vector2D get2DJoystickVector(edu.wpi.first.wpilibj.GenericHID.Hand hand)
-
get2DJoystickAngle
public double get2DJoystickAngle(edu.wpi.first.wpilibj.GenericHID.Hand hand)
Gets angle from a 2D joystick- Parameters:
hand
- Left vs right joystick of the xbox this- Returns:
- Angle in radians counter-clockwise from 12 o'clock
-
get2DJoystickMagnitude
public double get2DJoystickMagnitude(edu.wpi.first.wpilibj.GenericHID.Hand hand)
-
getButton
public StrictDPadButton getButton(DPadAxis button)
-
getButton
public edu.wpi.first.wpilibj2.command.button.JoystickButton getButton(ChickenXboxController.XboxButton button)
-
getButton
public AxisButton getButton(ChickenXboxController.XboxAxis axis, double threshold)
-
getButton
public MultiAxisButton getButton(double threshold, ChickenXboxController.XboxAxis... axes)
-
getAxis
public ChickenXboxController.Axis getAxis(ChickenXboxController.XboxAxis axis)
-
getAxis
public ChickenXboxController.Axis getAxis(int axis)
-
getXAxis
public ChickenXboxController.Axis getXAxis(edu.wpi.first.wpilibj.GenericHID.Hand hand)
-
getYAxis
public ChickenXboxController.Axis getYAxis(edu.wpi.first.wpilibj.GenericHID.Hand hand)
-
getRectifiedXAxis
public ChickenXboxController.Axis getRectifiedXAxis(edu.wpi.first.wpilibj.GenericHID.Hand hand)
-
getRectifiedYAxis
public ChickenXboxController.Axis getRectifiedYAxis(edu.wpi.first.wpilibj.GenericHID.Hand hand)
-
getJoystick
public ChickenXboxController.Axis2D getJoystick(edu.wpi.first.wpilibj.GenericHID.Hand hand)
-
-