Skip to content

Commit

Permalink
arjun!!!!!!! no work fix lol
Browse files Browse the repository at this point in the history
  • Loading branch information
scotus-1 committed Mar 7, 2025
1 parent 8425c19 commit 5ed6df6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion simgui-ds.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
}
],
"robotJoysticks": [
{},
{
"guid": "Keyboard0"
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void loadCommands() {
() -> slewX.calculate(driveController.getLeftY()),
() -> slewY.calculate(driveController.getLeftX()),
() -> slewTheta.calculate(-driveController.getRightX()),
driveSubsystem.getRotation()
() -> driveSubsystem.getRotation()
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@
import frc.robot.subsystems.DriveSubsystem.DriveSubsystem;

import java.util.function.DoubleSupplier;
import java.util.function.Supplier;

public class FieldRelativeDriveCommand extends Command {
private final DriveSubsystem drive;
private final DoubleSupplier xSupplier;
private final DoubleSupplier ySupplier;
private final DoubleSupplier omegaSupplier;

private final Rotation2d heading_fieldRelative;
private final Supplier<Rotation2d> headingSupplier;

public FieldRelativeDriveCommand(DriveSubsystem drive, DoubleSupplier xSupplier, DoubleSupplier ySupplier, DoubleSupplier omegaSupplier, Rotation2d heading_fieldRelative) {
public FieldRelativeDriveCommand(DriveSubsystem drive, DoubleSupplier xSupplier, DoubleSupplier ySupplier, DoubleSupplier omegaSupplier, Supplier<Rotation2d> headingSupplier) {
this.drive = drive;
this.xSupplier = xSupplier;
this.ySupplier = ySupplier;
this.omegaSupplier = omegaSupplier;
this.heading_fieldRelative = heading_fieldRelative;
this.headingSupplier = headingSupplier;
}


Expand Down Expand Up @@ -61,7 +62,7 @@ public void execute() {
omega * Math.PI * 1.5
);

Rotation2d headingFlipped = heading_fieldRelative;
Rotation2d headingFlipped = headingSupplier.get();

if (isFlipped) {
headingFlipped = headingFlipped.plus(Rotation2d.fromDegrees(180));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/constants/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* constants are needed, to reduce verbosity.
*/
public final class Constants {
public static final Mode currentMode = Mode.REAL;
public static final Mode currentMode = Mode.SIM;

public static enum Mode {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/subsystems/DriveSubsystem/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public void periodic() {
Logger.processInputs("Drive/Module" + Integer.toString(index), inputs);

// Calculate positions for odometry
// int sampleCount = inputs.odometryPhoenixTimestamps.length; // All signals are sampled together
int sampleCount = inputs.odometryPhoenixTimestamps.length; // All signals are sampled together

int sampleCount = Math.min(inputs.odometryPhoenixTimestamps.length, inputs.odometrySparkTimestamps.length);
// int sampleCount = Math.min(inputs.odometryPhoenixTimestamps.length, inputs.odometrySparkTimestamps.length);
// System.out.println(inputs.odometrySparkTimestamps.length + " " + inputs.odometryPhoenixTimestamps.length);
odometryPositions = new SwerveModulePosition[sampleCount];
for (int i = 0; i < sampleCount; i++) {
Expand Down

0 comments on commit 5ed6df6

Please sign in to comment.