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 interfaceChickenXboxController.Axisstatic interfaceChickenXboxController.Axis2Dstatic classChickenXboxController.XboxAxisstatic classChickenXboxController.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 doubleget2DJoystickAngle(edu.wpi.first.wpilibj.GenericHID.Hand hand)Gets angle from a 2D joystickdoubleget2DJoystickMagnitude(edu.wpi.first.wpilibj.GenericHID.Hand hand)org.apache.commons.math3.geometry.euclidean.twod.Vector2Dget2DJoystickVector(edu.wpi.first.wpilibj.GenericHID.Hand hand)ChickenXboxController.AxisgetAxis(int axis)ChickenXboxController.AxisgetAxis(ChickenXboxController.XboxAxis axis)MultiAxisButtongetButton(double threshold, ChickenXboxController.XboxAxis... axes)StrictDPadButtongetButton(DPadAxis button)AxisButtongetButton(ChickenXboxController.XboxAxis axis, double threshold)edu.wpi.first.wpilibj2.command.button.JoystickButtongetButton(ChickenXboxController.XboxButton button)ChickenXboxController.Axis2DgetJoystick(edu.wpi.first.wpilibj.GenericHID.Hand hand)doublegetRawAxis(ChickenXboxController.XboxAxis axis)doublegetRectifiedX(edu.wpi.first.wpilibj.GenericHID.Hand hand)Get the X axis value of the controller in the official 1540 coordinate systemChickenXboxController.AxisgetRectifiedXAxis(edu.wpi.first.wpilibj.GenericHID.Hand hand)doublegetRectifiedY(edu.wpi.first.wpilibj.GenericHID.Hand hand)Get the Y axis value of the controller in the official 1540 coordinate systemChickenXboxController.AxisgetRectifiedYAxis(edu.wpi.first.wpilibj.GenericHID.Hand hand)ChickenXboxController.AxisgetXAxis(edu.wpi.first.wpilibj.GenericHID.Hand hand)ChickenXboxController.AxisgetYAxis(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)
-
-