diff --git a/src/main/java/frc/robot/controls/DriveControls.java b/src/main/java/frc/robot/controls/DriveControls.java index 62fd356..a5d0380 100644 --- a/src/main/java/frc/robot/controls/DriveControls.java +++ b/src/main/java/frc/robot/controls/DriveControls.java @@ -146,8 +146,8 @@ public class DriveControls { Rotation2d BumpcurrentAngle = drivetrain.getState().Pose.getRotation(); double BumpcurrentRad = BumpcurrentAngle.getRadians(); - double targetA = Math.toRadians(135.0); - double targetB = Math.toRadians(-135.0); + double targetA = Math.toRadians(45); + double targetB = Math.toRadians(-45); // 计算误差 double errorA = targetA - BumpcurrentRad; double errorB = targetB - BumpcurrentRad; diff --git a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java index 23337d0..6ed5a32 100644 --- a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java @@ -114,7 +114,7 @@ public class ShooterSubsystem extends SubsystemBase { // 使用PID控制器来计算背板的运动速度 double pidOutput = backboardPID.calculate(getBackboardPosition()); - pidOutput = Math.max(-Constants.Shooter.backboardSpeedMax, Math.min(Constants.Shooter.backboardSpeedMax, pidOutput)); // 限制输出范围在-1到1之间 + pidOutput = Math.max(-Constants.Shooter.backboardSpeedMax, Math.min(Constants.Shooter.backboardSpeedMax, pidOutput)); // 限制输出范围 shooterNetworkTable.getEntry("backboardPIDOutput").setDouble(pidOutput); // // 设置背板电机的速度,根据PID输出进行调整 setBackboardSpeedByRPS(pidOutput);