Skip to content

Commit

Permalink
Merge branch 'pre-marc' into amp-bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Vignesh1234587 authored Aug 14, 2024
2 parents c2a8227 + c0e1373 commit 5bab88d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/main/java/frc/robot/BuildConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public final class BuildConstants {
public static final String MAVEN_GROUP = "";
public static final String MAVEN_NAME = "2024 Robot Code";
public static final String VERSION = "unspecified";

public static final int GIT_REVISION = 321;
public static final String GIT_SHA = "595783aa307f432a03116af1c4f77599478ee51c";
public static final String GIT_DATE = "2024-08-12 20:54:55 EDT";
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,15 @@ public static class ModuleConstants {
public static final double DRIVE_GEAR_RATIO = 6.12;
public static final double TURN_GEAR_RATIO = 150.0 / 7.0;

public static final double DRIVE_STATOR_CURRENT_LIMIT = 40.0;
public static final double DRIVE_STATOR_CURRENT_LIMIT = 90.0;
public static final boolean DRIVE_STATOR_CURRENT_LIMIT_ENABLED = true;
public static final double DRIVE_SUPPLY_CURRENT_LIMIT = 42.0;
public static final boolean DRIVE_SUPPLY_CURRENT_LIMIT_ENABLED = true;

public static final double TURN_STATOR_CURRENT_LIMIT = 30.0;
public static final boolean TURN_STATOR_CURRENT_LIMIT_ENABLED = true;
public static final double TURN_SUPPLY_CURRENT_LIMIT = 30.0;
public static final boolean TURN_SUPPLY_CURRENT_LIMIT_ENABLED = true;
}

public static class IntakeConstants {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/AimbotTele.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void angleShooter() {
double shootingSpeed = calculateShooterSpeed(Units.metersToFeet(distanceToSpeakerMeter));

shooter.setFlywheelRPMs(shootingSpeed, shootingSpeed + 100);
} else shooter.setFlywheelRPMs(5400 - 200, 5400 - 400);
} else shooter.setFlywheelRPMs(5400 - 100, 5400 - 800);
pivot.setPivotGoal(calculatePivotAngleDeg(distanceToSpeakerMeter));
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/commands/ScoreAmp.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ public class ScoreAmp extends SequentialCommandGroup {
/** Creates a new ScoreAmp. */
public ScoreAmp(Elevator elevator, Pivot pivot, Shooter shooter, Drive drive) {
addCommands(
amp-bar
new ParallelCommandGroup(
new InstantCommand(() -> elevator.setConstraints(100, 640), elevator),
new InstantCommand(() -> shooter.setFlywheelRPMs(2400, 2400), shooter),
new SetPivotTarget(Constants.PivotConstants.AMP_SETPOINT_DEG, pivot)),
new SetAmpBarTarget(195, 0, elevator),

new SetElevatorTarget(6, 1, elevator));

// addCommands(
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/frc/robot/subsystems/drive/ModuleIOTalonFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ public ModuleIOTalonFX(int index) {
Constants.ModuleConstants.DRIVE_STATOR_CURRENT_LIMIT;
driveConfig.CurrentLimits.StatorCurrentLimitEnable =
Constants.ModuleConstants.DRIVE_STATOR_CURRENT_LIMIT_ENABLED;
driveConfig.CurrentLimits.SupplyCurrentLimit =
Constants.ModuleConstants.DRIVE_SUPPLY_CURRENT_LIMIT;
driveConfig.CurrentLimits.SupplyCurrentLimitEnable =
Constants.ModuleConstants.DRIVE_SUPPLY_CURRENT_LIMIT_ENABLED;

driveTalon.getConfigurator().apply(driveConfig);
setDriveBrakeMode(true);
// setDriveOpenLoopRamp(Constants.SwerveConstants.OPEN_LOOP_RAMP_SEC);
Expand All @@ -107,6 +112,10 @@ public ModuleIOTalonFX(int index) {
Constants.ModuleConstants.TURN_STATOR_CURRENT_LIMIT;
turnConfig.CurrentLimits.StatorCurrentLimitEnable =
Constants.ModuleConstants.TURN_STATOR_CURRENT_LIMIT_ENABLED;
turnConfig.CurrentLimits.SupplyCurrentLimit =
Constants.ModuleConstants.TURN_SUPPLY_CURRENT_LIMIT;
turnConfig.CurrentLimits.SupplyCurrentLimitEnable =
Constants.ModuleConstants.TURN_SUPPLY_CURRENT_LIMIT_ENABLED;
turnTalon.getConfigurator().apply(turnConfig);
setTurnBrakeMode(true);

Expand Down

0 comments on commit 5bab88d

Please sign in to comment.