mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-08 16:28:07 -06:00
dpad try
This commit is contained in:
@@ -8,10 +8,32 @@ import frc4388.robot.Constants.OIConstants;
|
||||
|
||||
public class DeadbandedXboxController extends XboxController {
|
||||
public DeadbandedXboxController(int port) { super(port); }
|
||||
|
||||
@Override public double getLeftX() { return skewToDeadzonedCircle(super.getLeftX(), super.getLeftY()).getX(); }
|
||||
@Override public double getLeftY() { return skewToDeadzonedCircle(super.getLeftX(), super.getLeftY()).getY(); }
|
||||
@Override public double getRightX() { return skewToDeadzonedCircle(super.getRightX(), super.getRightY()).getX(); }
|
||||
@Override public double getRightY() { return skewToDeadzonedCircle(super.getRightX(), super.getRightY()).getY(); }
|
||||
|
||||
public int getDpadAngle() {
|
||||
return getPOV(0);
|
||||
}
|
||||
|
||||
public boolean getDPadLeft(){
|
||||
return (getRawAxis(6) < -0.9);
|
||||
}
|
||||
|
||||
public boolean getDPadRight(){
|
||||
return (getRawAxis(6) > 0.9);
|
||||
}
|
||||
|
||||
public boolean getDPadTop(){
|
||||
return (getRawAxis(6) < 0.9);
|
||||
}
|
||||
|
||||
public boolean getDPadBottom(){
|
||||
return (getRawAxis(6) > -0.9);
|
||||
}
|
||||
|
||||
public static Translation2d skewToDeadzonedCircle(double x, double y) {
|
||||
Translation2d translation2d = new Translation2d(x, y);
|
||||
double magnitude = translation2d.getNorm();
|
||||
|
||||
Reference in New Issue
Block a user