0
This commit is contained in:
Alyssum-chenyiyi
2026-03-03 19:37:30 +08:00
parent cae3810ef5
commit fe6c097947
4 changed files with 23 additions and 17 deletions
+4 -4
View File
@@ -97,8 +97,8 @@ public final class Constants {
public class Intaker { public class Intaker {
public static final double intakeRotaterUpLimit = 0.0; // rotator上限角度 public static final double intakeRotaterUpLimit = 0.0; // rotator上限角度
public static final double intakeRotaterDownLimit = 0.0; // rotator下限角度 public static final double intakeRotaterDownLimit = -7.6; // rotator下限角度
public static final double intakeRotaterVelocity = 10; // rotater的速度(如果你用速度控制的话) public static final double intakeRotaterVelocity = 5; // rotater的速度(如果你用速度控制的话)
public static final double IntakeRotaterGravityFF = 0.0; // 重力前馈增益(需要实测调整) public static final double IntakeRotaterGravityFF = 0.0; // 重力前馈增益(需要实测调整)
public static final Slot0Configs intakeGetterSlot0Configs = new Slot0Configs() public static final Slot0Configs intakeGetterSlot0Configs = new Slot0Configs()
@@ -115,8 +115,8 @@ public final class Constants {
// 单位RPS // 单位RPS
public static final double positionToleranceRotations = 0.00; public static final double positionToleranceRotations = 0.00;
//rotater容差 //rotater容差
public static final double IntakeGetterK = 1.0; // intake getter速度与触发器输入的比例 public static final double IntakeGetterK = 0.3; // intake getter速度与触发器输入的比例
public static final double Getterminspeed = 20; // intake getter的基础速度(即触发器输入为0时的速度,正值表示默认向内转) public static final double Getterminspeed = 0.2; // intake getter的基础速度(即触发器输入为0时的速度,正值表示默认向内转)
} }
public static class Climber { public static class Climber {
+1 -1
View File
@@ -73,7 +73,7 @@ public class RobotContainer {
SignalLogger.enableAutoLogging(false); SignalLogger.enableAutoLogging(false);
autoChooser = AutoBuilder.buildAutoChooser(); autoChooser = AutoBuilder.buildAutoChooser();
SmartDashboard.putData("Auto Chooser", autoChooser); SmartDashboard.putData("Auto Chooser", autoChooser);
configueSwerve(); //configueSwerve();
configueShooter(); configueShooter();
configueClimber(); configueClimber();
bingdingLED(); bingdingLED();
@@ -25,7 +25,6 @@ public class ClimberSubsystem extends SubsystemBase {
private final VelocityVoltage velocityRequest = new VelocityVoltage(0).withSlot(0); private final VelocityVoltage velocityRequest = new VelocityVoltage(0).withSlot(0);
private double holdPositionTicks = 0.0; private double holdPositionTicks = 0.0;
private double deltaPositionTicks = 0.0;
private final NetworkTable climberTable; private final NetworkTable climberTable;
@@ -76,7 +76,7 @@ public class IntakerSubsystem extends SubsystemBase{
// } // }
// } // }
public void setIntakerGetterSpeed(double speed) { public void setIntakerGetterSpeed(double speed) {
intakegetter.setControl(velocityRequest.withVelocity(speed)); intakegetter.set(speed);
} }
public void zeroEncoder(){ public void zeroEncoder(){
intakerotater.setPosition(0); intakerotater.setPosition(0);
@@ -84,18 +84,25 @@ public class IntakerSubsystem extends SubsystemBase{
} }
public void IntakerDownNonStop(){ public void IntakerDownNonStop(){
double currentPosition = getIntakerotaterPosition(); double currentPosition = getIntakerotaterPosition();
if (currentPosition < Constants.Intaker.intakeRotaterDownLimit) { if (currentPosition > Constants.Intaker.intakeRotaterDownLimit) {
intakerotater.setControl(velocityRequest.withVelocity(Constants.Intaker.intakeRotaterVelocity));
} else { intakerotater.set(-0.05);}
stopIntakerotater(); // double currentPosition = getIntakerotaterPosition();
} // if (currentPosition > Constants.Intaker.intakeRotaterDownLimit) {
// intakerotater.setControl(velocityRequest.withVelocity(Constants.Intaker.intakeRotaterVelocity));
// } else {
// stopIntakerotater();
// }
} }
public void IntakerUpNonStop(){ public void IntakerUpNonStop(){
double currentPosition = getIntakerotaterPosition(); double currentPosition = getIntakerotaterPosition();
if (currentPosition > Constants.Intaker.intakeRotaterUpLimit) { if (currentPosition < Constants.Intaker.intakeRotaterUpLimit) {
intakerotater.setControl(velocityRequest.withVelocity(-Constants.Intaker.intakeRotaterVelocity)); intakerotater.set(0.1);}
} else {
stopIntakerotater(); // if (currentPosition < Constants.Intaker.intakeRotaterUpLimit) {
} // intakerotater.setControl(velocityRequest.withVelocity(-Constants.Intaker.intakeRotaterVelocity));
// } else {
// stopIntakerotater();
// }
} }
} }