修复底盘自动瞄准trench和bmp
This commit is contained in:
@@ -157,6 +157,7 @@ public class DriveControls {
|
||||
Math.max(Math.abs(raw), 0.4),
|
||||
raw
|
||||
);
|
||||
vy = isRedAlliance ? -vy : vy;
|
||||
}
|
||||
autoControlNetworkTable.getEntry("BumpDifference").setDouble(differenceBump);
|
||||
|
||||
@@ -186,6 +187,7 @@ public class DriveControls {
|
||||
Math.max(Math.abs(raw), 0.4),
|
||||
raw
|
||||
);
|
||||
vy = isRedAlliance ? -vy : vy;
|
||||
}
|
||||
autoControlNetworkTable.getEntry("TrenchDifference").setDouble(differenceTrench);
|
||||
Rotation2d currentAngle = drivetrain.getState().Pose.getRotation();
|
||||
@@ -209,7 +211,8 @@ public class DriveControls {
|
||||
if (fieldCentricEnabled || isAutoLike) {
|
||||
|
||||
// 自动状态用 BlueAlliance(不翻转),手柄 field-centric 仍用原 fieldCentric(OperatorPerspective)
|
||||
var chosen = isAutoLike ? fieldCentricAuto : fieldCentric;
|
||||
//var chosen = isAutoLike ? fieldCentricAuto : fieldCentric;
|
||||
var chosen = fieldCentric;
|
||||
return chosen
|
||||
.withVelocityX(vx)
|
||||
.withVelocityY(vy)
|
||||
|
||||
@@ -75,6 +75,7 @@ public class IntakerControls {
|
||||
double getterspeed = 0;
|
||||
double conveyoyspeedforintake = 15;
|
||||
double statorCurrent = ShooterSubsystem.getConveyorStatorCurrent();
|
||||
|
||||
if (controller.getLeftTriggerAxis() > 0.1) {
|
||||
getterspeed = controller.getLeftTriggerAxis() * Constants.Intaker.IntakeGetterK + Constants.Intaker.Getterminspeed;
|
||||
ShooterSubsystem.setConveyorSpeedByRPS(conveyoyspeedforintake);
|
||||
|
||||
@@ -274,6 +274,10 @@ public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Su
|
||||
|
||||
return true;
|
||||
}
|
||||
public void setLimelightIntakerPipeline(int pipeline){
|
||||
LimelightSupplier.setPipeline(pipeline);
|
||||
}
|
||||
|
||||
public String driveToAprilTag(){
|
||||
//Rotation2d targetHeading = getPose().getRotation();
|
||||
if(!LimelightSupplier.isTargetVisible() ){
|
||||
@@ -322,11 +326,6 @@ public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Su
|
||||
}
|
||||
|
||||
|
||||
positioningNetworkTable.getEntry("interestPointsClimb tx").setDouble(tx);
|
||||
positioningNetworkTable.getEntry("interestPointsClimb targetTz").setDouble(targetTz);
|
||||
positioningNetworkTable.getEntry("interestPointsClimb ry").setDouble(ry);
|
||||
|
||||
|
||||
ChassisSpeeds scaled = new ChassisSpeeds(
|
||||
tx, // X 不变
|
||||
targetTz, // Y 不变
|
||||
|
||||
@@ -86,6 +86,6 @@ public class IntakerSubsystem extends SubsystemBase{
|
||||
intakerotater.set(-0.05);
|
||||
}
|
||||
public void IntakerUpNonStop(){
|
||||
intakerotater.set(0.2);
|
||||
intakerotater.set(0.1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user