1
This commit is contained in:
@@ -22,17 +22,53 @@
|
|||||||
"pathName": "Shoot to Climb Step1 Red"
|
"pathName": "Shoot to Climb Step1 Red"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "wait",
|
||||||
|
"data": {
|
||||||
|
"waitTime": 1.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "climb_up"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "wait",
|
||||||
|
"data": {
|
||||||
|
"waitTime": 1.0
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"data": {
|
"data": {
|
||||||
"pathName": "Climb Step2 Red"
|
"pathName": "Climb Step2 Red"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "wait",
|
||||||
|
"data": {
|
||||||
|
"waitTime": 1.0
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"data": {
|
"data": {
|
||||||
"pathName": "Climb Step3 Red"
|
"pathName": "Climb Step3 Red"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "wait",
|
||||||
|
"data": {
|
||||||
|
"waitTime": 2.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "named",
|
||||||
|
"data": {
|
||||||
|
"name": "climb_down"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ public final class Constants {
|
|||||||
|
|
||||||
public static double climbUpTicks = 94; // TODO: 实测后调整
|
public static double climbUpTicks = 94; // TODO: 实测后调整
|
||||||
public static double climbDownTicks = 0; // TODO: 实测后调整
|
public static double climbDownTicks = 0; // TODO: 实测后调整
|
||||||
public static double climbDownAutoTicks = -5; // TODO: 实测后调整,自动爬时可能不需要完全降到底
|
public static double climbDownAutoTicks = 0; // TODO: 实测后调整,自动爬时可能不需要完全降到底
|
||||||
public static final double climbVelocity = -200;
|
public static final double climbVelocity = -200;
|
||||||
public static final double holdToleranceRot = 0.5;
|
public static final double holdToleranceRot = 0.5;
|
||||||
public static final double deltaDownTicks = 1;
|
public static final double deltaDownTicks = 1;
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ public class RobotContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void configueClimber() {
|
private void configueClimber() {
|
||||||
enableTrigger.onTrue(climberControls.enableInitCommand());
|
//enableTrigger.onTrue(climberControls.enableInitCommand());
|
||||||
climberSubsystem.setDefaultCommand(climberControls.defaultClimberCommand());
|
climberSubsystem.setDefaultCommand(climberControls.defaultClimberCommand());
|
||||||
//controllerupper.b().onTrue(climberControls.resetClimberEncoderCommand(climberSubsystem));
|
//controllerupper.b().onTrue(climberControls.resetClimberEncoderCommand(climberSubsystem));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,17 +49,19 @@ import frc.robot.Constants.RobotStatus;
|
|||||||
public static Command climb_up(ClimberSubsystem climber) {
|
public static Command climb_up(ClimberSubsystem climber) {
|
||||||
return new RunCommand(() -> {
|
return new RunCommand(() -> {
|
||||||
climber.climbUp(); // 控制爬升器上升
|
climber.climbUp(); // 控制爬升器上升
|
||||||
}, climber).withTimeout(1.0).andThen(new RunCommand(() -> {
|
}, climber).withTimeout(2).andThen(new RunCommand(() -> {
|
||||||
climber.climbUpNonStopforAuto();
|
climber.climbUpNonStopforAuto();
|
||||||
}, climber).withTimeout(0.5)).andThen(new InstantCommand(() -> {
|
}, climber).withTimeout(0.5)).andThen(new InstantCommand(() -> {
|
||||||
|
climber.captureHoldPosition(); // 捕获当前爬升器位置以保持
|
||||||
climber.holdPosition(); // 停止并锁定当前爬升器位置
|
climber.holdPosition(); // 停止并锁定当前爬升器位置
|
||||||
}, climber));
|
}, climber));
|
||||||
}
|
}
|
||||||
public static Command climb_down(ClimberSubsystem climber) {
|
public static Command climb_down(ClimberSubsystem climber) {
|
||||||
return new RunCommand(() -> {
|
return new RunCommand(() -> {
|
||||||
climber.climbDownAuto(); // 控制爬升器下降
|
climber.climbDown(); // 控制爬升器下降
|
||||||
}, climber).withTimeout(2.0) //
|
}, climber).withTimeout(2.0) //
|
||||||
.andThen(new InstantCommand(() -> {
|
.andThen(new InstantCommand(() -> {
|
||||||
|
climber.captureHoldPosition(); // 捕获当前爬升器位置以保持
|
||||||
climber.holdPosition(); // 停止并锁定当前爬升器位置
|
climber.holdPosition(); // 停止并锁定当前爬升器位置
|
||||||
}, climber));
|
}, climber));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,17 @@ public class TunerConstants {
|
|||||||
);
|
);
|
||||||
private static final CANcoderConfiguration encoderInitialConfigs = new CANcoderConfiguration();
|
private static final CANcoderConfiguration encoderInitialConfigs = new CANcoderConfiguration();
|
||||||
// Configs for the Pigeon 2; leave this null to skip applying Pigeon 2 configs
|
// Configs for the Pigeon 2; leave this null to skip applying Pigeon 2 configs
|
||||||
private static final Pigeon2Configuration pigeonConfigs = null;
|
private static final Pigeon2Configuration pigeonConfigs =
|
||||||
|
new Pigeon2Configuration()
|
||||||
|
.withGyroTrim(
|
||||||
|
new GyroTrimConfigs()
|
||||||
|
.withGyroScalarZ(-5.0)
|
||||||
|
)
|
||||||
|
.withPigeon2Features(
|
||||||
|
new Pigeon2FeaturesConfigs()
|
||||||
|
.withEnableCompass(false)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// CAN bus that the devices are located on;
|
// CAN bus that the devices are located on;
|
||||||
// All swerve devices must share the same CAN bus
|
// All swerve devices must share the same CAN bus
|
||||||
|
|||||||
Reference in New Issue
Block a user