This commit is contained in:
Alyssum-chenyiyi
2026-02-28 14:28:31 +08:00
parent a5a360222e
commit 4fd6760bed
@@ -19,8 +19,8 @@ public class ShooterControls {
private double backboardPositionOffset = 0.0;
private NetworkTable shooterControlTable;
private double conveyorSpeed = 0.0;
double flywheelSpeed = 0;
double backboardPosition = 0;
private double flywheelSpeed = 0;
private double backboardPosition = 0;
private final RobotStatusManager robotStatusManager;
public ShooterControls(ShooterSubsystem shooterSubsystem, CommandXboxController controller,RobotStatusManager rsm) {
this.shooterSubsystem = shooterSubsystem;
@@ -37,9 +37,12 @@ public class ShooterControls {
break;
case AllTelop:
case PassingBall:
flywheelSpeed = 0;//todo:实测传球的时候的速度
var xP = shooterSubsystem.getDistance();
//xP = Math.max(1.2, Math.min(4.5, xP));
flywheelSpeed = 0.6956596811733782*xP*xP*xP*xP*xP*xP*xP-14.164408860183267*xP*xP*xP*xP*xP*xP+119.7115375240918*xP*xP*xP*xP*xP-543.0984876677477*xP*xP*xP*xP+1425.1928543240738*xP*xP*xP-2156.199296490315*xP*xP+1736.568139600292*xP-516.097598057351;
flywheelSpeed += flywheelSpeedOffset;
backboardPosition = 0;//todo:实测传球的时候的背板位置
backboardPosition = xP*xP;//todo:实测传球的时候的背板位置 打表
backboardPosition += backboardPositionOffset;
conveyorSpeed = Constants.Shooter.conveyorSpeed;
if (controller.getRightTriggerAxis() < 0.1) {