diff --git a/src/main/java/com/spartronics4915/frc/Constants.java b/src/main/java/com/spartronics4915/frc/Constants.java index 2391a0f..e45665a 100644 --- a/src/main/java/com/spartronics4915/frc/Constants.java +++ b/src/main/java/com/spartronics4915/frc/Constants.java @@ -47,18 +47,19 @@ public DeviceSpec(String nm, int id, int nbut) } // from atlas 2020 - public static final class DriveStraightConstants - { - public static final double kP = 0; // Was 0.4 - public static final double kI = 0.2; - public static final double kD = 0; - public static final double kAllowedError = 0; // In degrees - } + // public static final class DriveStraightConstants + // { + // public static final double kP = 0; // Was 0.4 + // public static final double kI = 0.2; + // public static final double kD = 0; + // public static final double kAllowedError = 0; // In degrees + // } public static final class JoystickMotorConstants { - public static final double kMotorSpeedMultiplier = 1; + public static final double kMotorSpeedMultiplier = 0.5; public static final double kMotorSlowSpeed = 0.3; public static final double kJoystickDeadzone = 0.1; + public static final double kJoystickResponseCurve = 5.0/3.0; } } diff --git a/src/main/java/com/spartronics4915/frc/commands/JoystickMotorCommand.java b/src/main/java/com/spartronics4915/frc/commands/JoystickMotorCommand.java index a372a47..a2e2ba7 100644 --- a/src/main/java/com/spartronics4915/frc/commands/JoystickMotorCommand.java +++ b/src/main/java/com/spartronics4915/frc/commands/JoystickMotorCommand.java @@ -3,7 +3,7 @@ import edu.wpi.first.wpilibj2.command.CommandBase; import edu.wpi.first.wpilibj.Joystick; -import com.spartronics4915.frc.Constants; +import com.spartronics4915.frc.Constants.*; import com.spartronics4915.frc.subsystems.JoystickMotor; public class JoystickMotorCommand extends CommandBase @@ -29,7 +29,7 @@ public void execute() if (mSlow) { - y *= Constants.JoystickMotorConstants.kMotorSlowSpeed; + y *= JoystickMotorConstants.kMotorSlowSpeed; } if (mInverted) @@ -38,8 +38,8 @@ public void execute() } // copied from 2020-InfiniteRecharge, no idea how it works (magic) - y = Math.copySign(Math.pow(Math.abs(y), 5.0/3.0), y); // apply response curve - mJoystickMotor.set(applyDeadzone(y, Constants.JoystickMotorConstants.kJoystickDeadzone)); + y = Math.copySign(Math.pow(Math.abs(y), JoystickMotorConstants.kJoystickResponseCurve), y); // apply response curve + mJoystickMotor.set(applyDeadzone(y, JoystickMotorConstants.kJoystickDeadzone)); } // also copied from ir2020