Skip to content

Commit dff211b

Browse files
authored
Merge pull request #77 from strykeforce/worlds-hotfixes
Worlds hotfixes
2 parents 79b2c45 + 8c83d26 commit dff211b

File tree

15 files changed

+427
-291
lines changed

15 files changed

+427
-291
lines changed

src/main/deploy/choreo/bargeToI.traj

Lines changed: 314 additions & 237 deletions
Large diffs are not rendered by default.

src/main/java/frc/robot/commands/auton/DriveAlgaeAutonServoCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void initialize() {
117117
robotStateSubsystem.clearCoral();
118118
}
119119

120-
visionSubsystem.setIsAuto(false);
120+
// visionSubsystem.setIsAuto(false);
121121
robotStateSubsystem.setAutoAlgaeLevel(algaeLevel);
122122

123123
isServoing = false;

src/main/java/frc/robot/commands/auton/MiddleBargeAutonCommand.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public MiddleBargeAutonCommand(
4444
List<Double> delays,
4545
List<String> bargePaths,
4646
List<RobotStateSubsystem.ScoringLevel> algaeLevels,
47-
Pose2d startPose) {
47+
Pose2d startPose,
48+
double startDelay) {
4849
addRequirements(
4950
driveSubsystem, algaeSubsystem, biscuitSubsystem, coralSubsystem, elevatorSubsystem);
5051
this.driveSubsystem = driveSubsystem;
@@ -57,7 +58,8 @@ public MiddleBargeAutonCommand(
5758

5859
addCommands(
5960
new PrepOdomForAutoCommand(
60-
robotStateSubsystem, driveSubsystem, Rotation2d.fromDegrees(180.0), startPose));
61+
robotStateSubsystem, driveSubsystem, Rotation2d.fromDegrees(180.0), startPose),
62+
new WaitCommand(startDelay));
6163

6264
for (int i = 0; i < grabPaths.size(); i++) {
6365
boolean last = i == grabPaths.size() - 1;

src/main/java/frc/robot/constants/AlgaeConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class AlgaeConstants {
3030
public static final double kCoralHoldSpeed = -0.05;
3131
public static final double kBargeScoreSpeed = -1;
3232
public static final double kProcessorScoreSpeed = -1;
33-
public static final double kCoralScoreSpeed = 0.4; // 0.5;
33+
public static final double kCoralScoreSpeed = 0.3; // 0.5; was 0.4
3434
public static final double kIntakingSpeed = 1; // 0.75
3535
public static final double kCoralIntakingSpeed = -0.3; // -0.75;
3636

src/main/java/frc/robot/constants/AutonConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ public class AutonConstants {
2929
new Pose2d(7.1, 7.257, Rotation2d.fromDegrees(180));
3030

3131
public static final Pose2d kMiddleBargeStart =
32-
new Pose2d(7.1, 7.257, Rotation2d.fromDegrees(180));
32+
new Pose2d(7.1, 3.7209, Rotation2d.fromDegrees(180));
3333
}

src/main/java/frc/robot/constants/BargeAlignConstants.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ public class BargeAlignConstants {
77

88
public static final double kBlueEjectAlgaeX = 7.67; // 7.72
99
public static final double kRedEjectAlgaeX = 9.86; // 9.81
10-
public static final double kBlueRaiseElevatorX = 7.02; // 7.22
11-
public static final double kRedRaiseElevatorX = 10.51; // 10.31
10+
public static final double kBlueRaiseElevatorX = 6.82; // 7.02
11+
public static final double kRedRaiseElevatorX = 10.71; // 10.51
12+
13+
public static final double kBlueUnsafeX = 7.02;
14+
public static final double kRedUnsafeX = 10.51;
1215

1316
public static final Rotation2d kBlueDesiredYaw = Rotation2d.fromDegrees(0.0);
1417
public static final Rotation2d kRedDesiredYaw = Rotation2d.fromDegrees(180.0);

src/main/java/frc/robot/constants/RobotConstants.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ public static TalonFXSConfiguration getFXSConfig() {
349349

350350
public static class CompConstants {
351351
public static Angle kElevatorFunnelSetpoint = Rotations.of(0.3676757);
352-
public static Angle kElevatorL1LoadSetpoint = Rotations.of(0.278); // 0.63
352+
public static Angle kElevatorL1LoadSetpoint = Rotations.of(0.278 + 0.352); // 0.278
353353
public static Angle kElevatorStowSetpoint = kElevatorFunnelSetpoint;
354354

355355
// Biscuit
@@ -366,7 +366,7 @@ public static class CompConstants {
366366
// Idle
367367
public static Angle kBiscuitStowSetpoint = Rotations.of(1.862 / 2);
368368
public static Angle kFunnelSetpoint = kBiscuitStowSetpoint;
369-
public static Angle kL1CoralLoadSetpoint = Rotations.of(6.29); // 0.05 is about an inch
369+
public static Angle kL1CoralLoadSetpoint = Rotations.of(6.29 + 0.25); // was 6.29
370370
public static Angle kPrestageSetpoint = Rotations.of(-2.94);
371371
public static Angle kPrestageAlgaeSetpoint = kBiscuitStowSetpoint;
372372

@@ -437,12 +437,12 @@ public static TalonFXSConfiguration getFXSConfig() {
437437

438438
CurrentLimitsConfigs current =
439439
new CurrentLimitsConfigs()
440-
.withStatorCurrentLimit(100)
440+
.withStatorCurrentLimit(60)
441441
.withStatorCurrentLimitEnable(true)
442442
.withSupplyCurrentLimit(20)
443443
.withSupplyCurrentLowerLimit(5)
444444
.withSupplyCurrentLowerTime(2)
445-
.withSupplyCurrentLimitEnable(true);
445+
.withSupplyCurrentLimitEnable(false);
446446
fxsConfig.CurrentLimits = current;
447447

448448
HardwareLimitSwitchConfigs hwLimit =

src/main/java/frc/robot/constants/RobotStateConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class RobotStateConstants {
88
public static final double[] kNodeAngles = {0.0, 60.0, 120.0, 180.0, -120.0, -60.0};
99
public static final double kAlgaeRetreatDistance = 0;
1010

11-
public static final double kBlueBargeSafeX = 7; // 7.6
11+
public static final double kBlueBargeSafeX = 7.02; // 7.6
1212
public static final double kRedBargeSafeX = DriveConstants.kFieldMaxX - kBlueBargeSafeX;
1313

1414
public static final double kCoralEjectTimer = 0.25;

src/main/java/frc/robot/subsystems/auto/AutoSwitch.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ private AutoCommandInterface getAutoCommand(int switchPos) {
282282
PathHandlerConstants.kLoadLightDistance,
283283
PathHandlerConstants.kLoadLightDistance,
284284
PathHandlerConstants.kLoadLightDistance)),
285-
new ArrayList<>(Arrays.asList(-0.0175, 0.0, 0.0)),
285+
new ArrayList<>(Arrays.asList(-0.0075, -0.0075, -0.0075)),
286286
'j',
287287
false,
288288
AutonConstants.kNonProcessorMid);
@@ -348,10 +348,11 @@ private AutoCommandInterface getAutoCommand(int switchPos) {
348348
visionSubsystem,
349349
new ArrayList<String>(Arrays.asList("startBargeToG", "bargeToI", "bargeToE")),
350350
new ArrayList<Double>(Arrays.asList(0.0, 0.0, 0.0)),
351-
new ArrayList<Double>(Arrays.asList(0.5, 0.0, 0.0)),
351+
new ArrayList<Double>(Arrays.asList(0.0, 0.0, 0.0)),
352352
new ArrayList<String>(Arrays.asList("GToBarge", "IToBarge", "EToNearBarge")),
353353
new ArrayList<>(Arrays.asList(ScoringLevel.L2, ScoringLevel.L3, ScoringLevel.L3)),
354-
AutonConstants.kMiddleBargeStart);
354+
AutonConstants.kMiddleBargeStart,
355+
0.5);
355356
}
356357

357358
case 0x11 -> {
@@ -365,11 +366,12 @@ private AutoCommandInterface getAutoCommand(int switchPos) {
365366
tagAlignSubsystem,
366367
visionSubsystem,
367368
new ArrayList<String>(Arrays.asList("startBargeToG", "bargeToE", "bargeToI")),
368-
new ArrayList<Double>(Arrays.asList(0.0, 0.0, 0.0)),
369+
new ArrayList<Double>(Arrays.asList(-0.00475, 0.0, 0.0)),
369370
new ArrayList<Double>(Arrays.asList(0.0, 0.0, 0.0)),
370371
new ArrayList<String>(Arrays.asList("GToBarge", "EToBarge", "IToNearBarge")),
371372
new ArrayList<>(Arrays.asList(ScoringLevel.L2, ScoringLevel.L3, ScoringLevel.L3)),
372-
AutonConstants.kMiddleBargeStart);
373+
AutonConstants.kMiddleBargeStart,
374+
0.0);
373375
}
374376

375377
case 0x12 -> {
@@ -387,7 +389,8 @@ private AutoCommandInterface getAutoCommand(int switchPos) {
387389
new ArrayList<Double>(Arrays.asList(0.0, 0.0, 0.0)),
388390
new ArrayList<String>(Arrays.asList("GToBarge", "IToBarge", "bargeAway")),
389391
new ArrayList<>(Arrays.asList(ScoringLevel.L2, ScoringLevel.L3, ScoringLevel.L2)),
390-
AutonConstants.kMiddleBargeStart);
392+
AutonConstants.kMiddleBargeStart,
393+
2.0);
391394
}
392395

393396
case 0x13 -> {
@@ -405,7 +408,8 @@ private AutoCommandInterface getAutoCommand(int switchPos) {
405408
new ArrayList<Double>(Arrays.asList(0.0, 0.0, 0.0)),
406409
new ArrayList<String>(Arrays.asList("GToBarge", "EToBarge", "bargeAway")),
407410
new ArrayList<>(Arrays.asList(ScoringLevel.L2, ScoringLevel.L3, ScoringLevel.L2)),
408-
AutonConstants.kMiddleBargeStart);
411+
AutonConstants.kMiddleBargeStart,
412+
2.0);
409413
}
410414

411415
case 0x14 -> {
@@ -546,7 +550,7 @@ private AutoCommandInterface getAutoCommand(int switchPos) {
546550
PathHandlerConstants.kLoadLightDistance,
547551
PathHandlerConstants.kLoadLightDistance,
548552
PathHandlerConstants.kLoadLightDistance)),
549-
new ArrayList<>(Arrays.asList(0.0, 0.0, 0.0)),
553+
new ArrayList<>(Arrays.asList(-0.0075, -0.0075, -0.0075)),
550554
'e',
551555
true,
552556
AutonConstants.kProcessorMid);

src/main/java/frc/robot/subsystems/biscuit/BiscuitIOFXS.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import com.ctre.phoenix6.StatusSignal;
77
import com.ctre.phoenix6.configs.TalonFXSConfiguration;
88
import com.ctre.phoenix6.configs.TalonFXSConfigurator;
9-
import com.ctre.phoenix6.controls.MotionMagicDutyCycle;
9+
import com.ctre.phoenix6.controls.MotionMagicVoltage;
1010
import com.ctre.phoenix6.hardware.TalonFXS;
1111
import com.ctre.phoenix6.signals.ForwardLimitTypeValue;
1212
import edu.wpi.first.math.MathUtil;
@@ -42,6 +42,7 @@ public class BiscuitIOFXS implements BiscuitIO, Checkable {
4242
private StatusSignal<ForwardLimitTypeValue> fwdLimitSwitch;
4343
private StatusSignal<Angle> rawQuadrature;
4444
private StatusSignal<Angle> rawPulseWidth;
45+
// private StatusSignal<Current> statorCurrent;
4546
private boolean didZero;
4647
private boolean fwdLimitSwitchOpen;
4748
private Angle offset;
@@ -50,8 +51,8 @@ public class BiscuitIOFXS implements BiscuitIO, Checkable {
5051
private boolean isRemovingAlgae = false;
5152

5253
private TalonFXSConfigurator configurator;
53-
private MotionMagicDutyCycle positionRequest =
54-
new MotionMagicDutyCycle(0).withEnableFOC(false).withFeedForward(0);
54+
private MotionMagicVoltage positionRequest =
55+
new MotionMagicVoltage(0).withEnableFOC(false).withFeedForward(0);
5556

5657
public BiscuitIOFXS() {
5758
// Logger initialization with class name
@@ -73,6 +74,8 @@ public BiscuitIOFXS() {
7374
rawQuadrature.setUpdateFrequency(20);
7475
rawPulseWidth = talon.getRawPulseWidthPosition();
7576
rawPulseWidth.setUpdateFrequency(200);
77+
// statorCurrent = talon.getStatorCurrent();
78+
// statorCurrent.setUpdateFrequency(4);
7679
zero();
7780
}
7881

0 commit comments

Comments
 (0)