0227
This commit is contained in:
@@ -19,8 +19,8 @@ public class ShooterControls {
|
|||||||
private double backboardPositionOffset = 0.0;
|
private double backboardPositionOffset = 0.0;
|
||||||
private NetworkTable shooterControlTable;
|
private NetworkTable shooterControlTable;
|
||||||
private double conveyorSpeed = 0.0;
|
private double conveyorSpeed = 0.0;
|
||||||
double flywheelSpeed = 0;
|
private double flywheelSpeed = 0;
|
||||||
double backboardPosition = 0;
|
private double backboardPosition = 0;
|
||||||
private final RobotStatusManager robotStatusManager;
|
private final RobotStatusManager robotStatusManager;
|
||||||
public ShooterControls(ShooterSubsystem shooterSubsystem, CommandXboxController controller,RobotStatusManager rsm) {
|
public ShooterControls(ShooterSubsystem shooterSubsystem, CommandXboxController controller,RobotStatusManager rsm) {
|
||||||
this.shooterSubsystem = shooterSubsystem;
|
this.shooterSubsystem = shooterSubsystem;
|
||||||
@@ -37,9 +37,12 @@ public class ShooterControls {
|
|||||||
break;
|
break;
|
||||||
case AllTelop:
|
case AllTelop:
|
||||||
case PassingBall:
|
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;
|
flywheelSpeed += flywheelSpeedOffset;
|
||||||
backboardPosition = 0;//todo:实测传球的时候的背板位置
|
backboardPosition = xP*xP;//todo:实测传球的时候的背板位置 打表
|
||||||
backboardPosition += backboardPositionOffset;
|
backboardPosition += backboardPositionOffset;
|
||||||
conveyorSpeed = Constants.Shooter.conveyorSpeed;
|
conveyorSpeed = Constants.Shooter.conveyorSpeed;
|
||||||
if (controller.getRightTriggerAxis() < 0.1) {
|
if (controller.getRightTriggerAxis() < 0.1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user