mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 00:38:05 -06:00
sum chang
This commit is contained in:
@@ -209,14 +209,13 @@ public final class Constants {
|
||||
//Gains for hood
|
||||
public static final Gains SHOOTER_ANGLE_GAINS = new Gains(0.1, 0.0, 0.0, 0.0, 0, 0.7);
|
||||
|
||||
//#region test start
|
||||
|
||||
//#endregion test end
|
||||
public static final double TURRET_FORWARD_HARD_LIMIT = 18.429;
|
||||
public static final double TURRET_REVERSE_HARD_LIMIT = -106.454;
|
||||
|
||||
public static final double TURRET_FORWARD_SOFT_LIMIT = TURRET_FORWARD_HARD_LIMIT - 4;
|
||||
public static final double TURRET_FORWARD_SOFT_LIMIT = TURRET_FORWARD_HARD_LIMIT - 5;
|
||||
public static final double TURRET_REVERSE_SOFT_LIMIT = TURRET_REVERSE_HARD_LIMIT + 2;
|
||||
|
||||
public static final double TURRET_HARD_LIMIT_TOLERANCE = 20.0;
|
||||
//Shooter gains for actual Drum
|
||||
public static final Gains DRUM_SHOOTER_GAINS = new Gains(0.4, 0.0, 15.0, 0.05, 0, 0);
|
||||
|
||||
|
||||
@@ -146,16 +146,16 @@ public class Turret extends SubsystemBase {
|
||||
leftPrevState = leftState; // * Update the state of the left limit switch.
|
||||
|
||||
|
||||
// speed limiting near hard limits
|
||||
// * speed limiting near hard limits. tolerance (distance when ramping starts) is 20 rotations. speed at hard limits is 0.2 (percent output).
|
||||
double currentPos = this.getEncoderPosition();
|
||||
double forwardDistance = Math.abs(currentPos - ShooterConstants.TURRET_FORWARD_SOFT_LIMIT);
|
||||
double reverseDistance = Math.abs(currentPos - ShooterConstants.TURRET_REVERSE_SOFT_LIMIT);
|
||||
|
||||
if (forwardDistance < 20.0) {
|
||||
if (forwardDistance < ShooterConstants.TURRET_HARD_LIMIT_TOLERANCE) {
|
||||
this.speedLimiter = 0.2 + (forwardDistance * 0.05);
|
||||
}
|
||||
|
||||
if (reverseDistance < 20.0) {
|
||||
if (reverseDistance < ShooterConstants.TURRET_HARD_LIMIT_TOLERANCE) {
|
||||
this.speedLimiter = 0.2 + (reverseDistance * 0.05);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user