digital deadzone implementation

This commit is contained in:
aarav18
2022-02-28 16:46:40 -07:00
parent 343f423bb2
commit fa15241483
3 changed files with 29 additions and 15 deletions
+6 -2
View File
@@ -110,8 +110,12 @@ public final class Constants {
public static final Gains SHOOTER_ANGLE_GAINS = new Gains(0.05, 0.0, 0.0, 0.0, 0, 0.3);
public static final double SHOOTER_TURRET_MIN = -1.0;
public static final double DEADZONE_LEFT = 0.0;
public static final double DEADZONE_RIGHT = 340.0;
// deadzones
public static final double HARD_DEADZONE_LEFT = 0.0;
public static final double HARD_DEADZONE_RIGHT = 340.0;
public static final double DIG_DEADZONE_LEFT = 40.0;
public static final double DIG_DEADZONE_RIGHT = 60.0;
public static final int SHOOTER_FALCON_BALLER_ID = 0; //unknown value, fix later//
public static final int SHOOTER_FALCON_BALLER_FOLLOWER_ID = 0; //"//
@@ -50,11 +50,21 @@ public class AimToCenter extends CommandBase {
}
/**
* Checks if in deadzone.
* @return True if deadzone.
* Checks if in hardware deadzone (due to mechanical limitations).
* @param angle Angle to check.
* @return True if in hardware deadzone.
*/
public static boolean isDeadzone(double angle) {
return ((ShooterConstants.DEADZONE_LEFT > angle) || (angle > ShooterConstants.DEADZONE_RIGHT));
public static boolean isHardwareDeadzone(double angle) {
return ((ShooterConstants.HARD_DEADZONE_LEFT > angle) || (angle > ShooterConstants.HARD_DEADZONE_RIGHT));
}
/**
* Checks if in digital deadzone (due to climber).
* @param angle Angle to check.
* @return True if in digital deadzone.
*/
public static boolean isDigitalDeadzone(double angle) {
return ((ShooterConstants.DIG_DEADZONE_LEFT < angle) && (angle < ShooterConstants.DIG_DEADZONE_RIGHT));
}
// Called once the command ends or is interrupted.