Skip to content

Commit 1e11fce

Browse files
committed
dis 4
1 parent 85321f2 commit 1e11fce

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

src/main/java/frc/robot/Robot.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ public void autonomousInit() {
7575
drivetrain.resetGyro();
7676
drivetrain.resetRelativeEncoders();
7777
// JustDrive auto = new JustDrive(drivetrain);
78-
// DriveAndPlaceL1 auto = new DriveAndPlaceL1(drivetrain, coralJoint, storage);
78+
DriveAndPlaceL1 auto = new DriveAndPlaceL1(drivetrain, coralJoint, storage);
7979
// IBelieve auto = new IBelieve(drivetrain, coralJoint, storage);
80-
DriveWithAngle auto = new DriveWithAngle(drivetrain, coralJoint, storage);
80+
// DriveWithAngle auto = new DriveWithAngle(drivetrain, coralJoint, storage);
8181
auto.schedule();
8282
}
8383

src/main/java/frc/robot/commands/RotateStorage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public boolean isFinished() {
6262

6363
@Override
6464
public void end(boolean interrupted) {
65-
coralJoint.setDefaultCommand(new RotateStorage(coralJoint, coralJoint::getPosition));
65+
coralJoint.setDefaultCommand(new RotateStorage(coralJoint, setpoint));
6666
}
6767
}
6868

src/main/java/frc/robot/commands/autonomous/DriveAndPlaceL1.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package frc.robot.commands.autonomous;
22

3+
import com.spikes2212.command.genericsubsystem.commands.MoveGenericSubsystem;
34
import edu.wpi.first.wpilibj2.command.InstantCommand;
45
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
56
import frc.robot.commands.Drive;
@@ -19,9 +20,10 @@ public class DriveAndPlaceL1 extends SequentialCommandGroup {
1920

2021
public DriveAndPlaceL1(Drivetrain drivetrain, CoralJoint coralJoint, Storage storage) {
2122
addCommands(
23+
new MoveGenericSubsystem(coralJoint, -0.15).withTimeout(1),
2224
new DriveAtAngle(drivetrain, DRIVE_SPEED, () -> 0.0, () -> 0.0,
2325
false, false).withTimeout(DRIVE_TIMEOUT),
24-
new DriveAtAngle(drivetrain, () -> -0.2, () -> 0.0, () -> 0.0, false, false).withTimeout(0.5),
26+
new DriveAtAngle(drivetrain, () -> -0.2, () -> 0.0, () -> 0.0, false, false).withTimeout(0.75),
2527
new RotateStorage(coralJoint, CoralJoint.StoragePose.L1),
2628
new ReleaseCoral(storage),
2729
new InstantCommand(() -> {

src/main/java/frc/robot/commands/autonomous/DriveWithAngle.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package frc.robot.commands.autonomous;
22

3+
import com.spikes2212.command.genericsubsystem.commands.MoveGenericSubsystem;
34
import com.spikes2212.dashboard.SpikesLogger;
45
import edu.wpi.first.wpilibj2.command.InstantCommand;
56
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
@@ -20,13 +21,14 @@ public class DriveWithAngle extends SequentialCommandGroup {
2021
private static final Supplier<Double> DRIVE_SPEED_WITH_ANGLE_BACKWARD = () -> -0.2;
2122
private static final Supplier<Double> DRIVE_SPEED_FORWARD = () -> 0.7;
2223
private static final double DRIVE_TIMEOUT_WITH_ANGLE_FORWARD = 3;
23-
private static final double DRIVE_TIMEOUT_WITH_ANGLE_BACKWARD = 0.5;
24+
private static final double DRIVE_TIMEOUT_WITH_ANGLE_BACKWARD = 0.75;
2425
private static final double DRIVE_TIMEOUT_FORWARD = 2;
2526

2627
private final SpikesLogger logger = new SpikesLogger();
2728

2829
public DriveWithAngle(Drivetrain drivetrain, CoralJoint coralJoint, Storage storage) {
2930
addCommands(
31+
new MoveGenericSubsystem(coralJoint, -0.15).withTimeout(1),
3032
new DriveAtAngle(drivetrain, DRIVE_SPEED_WITH_ANGLE_FORWARD, () -> 0.0, () -> 0.0, false,
3133
false).withTimeout(DRIVE_TIMEOUT_WITH_ANGLE_FORWARD),
3234
new Drive(drivetrain, DRIVE_SPEED_FORWARD, () -> 0.0, () -> 0.0, false,

src/main/java/frc/robot/subsystems/CoralJoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class CoralJoint extends SmartMotorControllerGenericSubsystem {
1818

1919
public enum StoragePose {
2020

21-
INTAKE(12), L1(-10), L2(-30),
21+
INTAKE(12), L1(-11.5), L2(-30),
2222
L3(-15),
2323
RESTING(-30);
2424
// RESTING(0.0);

src/main/java/frc/robot/subsystems/SwerveModule.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class SwerveModule extends DashboardedSubsystem {
3131
private static final double DEGREES_TO_FLIP = 180;
3232
private static final double ABSOLUTE_POSITION_DISCONTINUITY_POINT = 1;
3333

34-
private static final double DRIVE_CURRENT_LIMIT = 40;
34+
private static final double DRIVE_CURRENT_LIMIT = 70;
3535
private static final double TURN_CURRENT_LIMIT = 40;
3636

3737
private final TalonFXWrapper driveMotor;
@@ -80,7 +80,7 @@ public void configureDriveController() {
8080
driveMotor.setEncoderConversionFactor(DRIVE_GEAR_RATIO * WHEEL_DIAMETER_INCHES
8181
* INCHES_TO_METERS * Math.PI);
8282
driveMotor.setInverted(driveInverted);
83-
// driveMotor.getConfigurator().apply(new CurrentLimitsConfigs().withSupplyCurrentLimit(DRIVE_CURRENT_LIMIT));
83+
driveMotor.getConfigurator().apply(new CurrentLimitsConfigs().withSupplyCurrentLimit(DRIVE_CURRENT_LIMIT));
8484
}
8585

8686
public void configureTurnController() {
@@ -188,5 +188,7 @@ public void end(boolean fuckYou) {
188188
driveMotor.stopMotor();
189189
}
190190
});
191+
namespace.putNumber("drive current", driveMotor::getCurrent);
192+
namespace.putNumber("turn current", turnMotor::getCurrent);
191193
}
192194
}

0 commit comments

Comments
 (0)