传入了所有场地坐标参数 上层操作手可控制底盘瞄准 传球待测试
This commit is contained in:
@@ -88,12 +88,12 @@ public final class Constants {
|
|||||||
public class Field {
|
public class Field {
|
||||||
public static final double RedHubPositionX = 11.914;
|
public static final double RedHubPositionX = 11.914;
|
||||||
public static final double RedHubPositionY = 4.034;
|
public static final double RedHubPositionY = 4.034;
|
||||||
public static final double BlueHubPositionX = 0;
|
public static final double BlueHubPositionX = 4.625;
|
||||||
public static final double BlueHubPositionY = 0;
|
public static final double BlueHubPositionY = 4.034;
|
||||||
public static final double PassingBallPosY1 = 2.51;
|
public static final double PassingBallPosY1 = 1.405;
|
||||||
public static final double PassingBallPosY2 = 5.556;
|
public static final double PassingBallPosY2 = 6.664;
|
||||||
public static final double RedPassingBallPosX = 0;
|
public static final double RedPassingBallPosX = 13.355;
|
||||||
public static final double BluePassingBallPosX = 0;
|
public static final double BluePassingBallPosX = 3.184;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -123,11 +123,16 @@ public class RobotContainer {
|
|||||||
// controllerlower.leftStick().onTrue(robotStatusManager.setStatusCommand(RobotStatus.AutoAimming));
|
// controllerlower.leftStick().onTrue(robotStatusManager.setStatusCommand(RobotStatus.AutoAimming));
|
||||||
// controllerlower.leftStick().onFalse(robotStatusManager.setStatusCommand(RobotStatus.AllTelop));
|
// controllerlower.leftStick().onFalse(robotStatusManager.setStatusCommand(RobotStatus.AllTelop));
|
||||||
|
|
||||||
//双操均可触发autoaimming
|
//双操均可触发autoaimming模式,松开时alltelop
|
||||||
Trigger autoAim = controllerupper.rightBumper().or(controllerlower.leftStick());
|
Trigger autoAim = controllerupper.rightBumper().or(controllerlower.rightStick());
|
||||||
autoAim.onTrue(robotStatusManager.setStatusCommand(RobotStatus.AutoAimming));
|
autoAim.onTrue(robotStatusManager.setStatusCommand(RobotStatus.AutoAimming));
|
||||||
autoAim.onFalse(robotStatusManager.setStatusCommand(RobotStatus.AllTelop));
|
autoAim.onFalse(robotStatusManager.setStatusCommand(RobotStatus.AllTelop));
|
||||||
|
|
||||||
|
//双操均可触发passingball模式,松开时alltelop
|
||||||
|
Trigger autoAim2 = controllerupper.leftBumper().or(controllerlower.leftStick());
|
||||||
|
autoAim2.onTrue(robotStatusManager.setStatusCommand(RobotStatus.PassingBall));
|
||||||
|
autoAim2.onFalse(robotStatusManager.setStatusCommand(RobotStatus.AllTelop));
|
||||||
|
|
||||||
controllerlower.leftTrigger()
|
controllerlower.leftTrigger()
|
||||||
.onTrue(robotStatusManager.setStatusCommand(RobotStatus.CrossingTrench))
|
.onTrue(robotStatusManager.setStatusCommand(RobotStatus.CrossingTrench))
|
||||||
.onFalse(robotStatusManager.setStatusCommand(RobotStatus.AllTelop));
|
.onFalse(robotStatusManager.setStatusCommand(RobotStatus.AllTelop));
|
||||||
|
|||||||
@@ -52,9 +52,6 @@ public class ShooterControls {
|
|||||||
if(shooterSubsystem.flywheelMotorLeft.getVelocity().getValueAsDouble()<flywheelSpeed*0.7){
|
if(shooterSubsystem.flywheelMotorLeft.getVelocity().getValueAsDouble()<flywheelSpeed*0.7){
|
||||||
conveyorSpeed = 0;
|
conveyorSpeed = 0;
|
||||||
}
|
}
|
||||||
// flywheelSpeed = calculateFlywheelSpeedOnlywithOffset(60);
|
|
||||||
// double flywheelSpeed = calculateFlywheelSpeed(0);
|
|
||||||
// double BackboardPosition = calculateBackboardPosition(0);
|
|
||||||
shooterControlTable.getEntry("flywheelTargetSpeed").setDouble(flywheelSpeed);
|
shooterControlTable.getEntry("flywheelTargetSpeed").setDouble(flywheelSpeed);
|
||||||
shooterControlTable.getEntry("conveyerTargetSpeed").setDouble(conveyorSpeed);
|
shooterControlTable.getEntry("conveyerTargetSpeed").setDouble(conveyorSpeed);
|
||||||
shooterControlTable.getEntry("backboardTargetPosition").setDouble(backboardPosition);
|
shooterControlTable.getEntry("backboardTargetPosition").setDouble(backboardPosition);
|
||||||
|
|||||||
Reference in New Issue
Block a user