Skip to content

Commit

Permalink
Update mini swerve cancoder constants (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
agrinmanriv0537 authored Jan 27, 2023
1 parent 6495231 commit 71c8c98
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 452 deletions.
61 changes: 0 additions & 61 deletions src/main/java/frc/robot/CTREModuleState.java

This file was deleted.

21 changes: 4 additions & 17 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.ctre.phoenix.motorcontrol.NeutralMode;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.kinematics.SwerveDriveKinematics;
import edu.wpi.first.math.trajectory.TrapezoidProfile;
import edu.wpi.first.math.util.Units;
import frc.lib.util.SwerveModuleConstants;

Expand Down Expand Up @@ -95,7 +94,7 @@ public static final class Mod0 {
public static final int driveMotorID = 50;
public static final int angleMotorID = 8;
public static final int canCoderID = 3;
public static final double angleOffset = 138.428;
public static final double angleOffset = 138.867;
public static final SwerveModuleConstants constants =
new SwerveModuleConstants(driveMotorID, angleMotorID, canCoderID, angleOffset);
}
Expand All @@ -107,7 +106,7 @@ public static final class Mod1 {
public static final int driveMotorID = 51;
public static final int angleMotorID = 52;
public static final int canCoderID = 2;
public static final double angleOffset = 87.891;
public static final double angleOffset = 109.775;
public static final SwerveModuleConstants constants =
new SwerveModuleConstants(driveMotorID, angleMotorID, canCoderID, angleOffset);
}
Expand All @@ -131,7 +130,7 @@ public static final class Mod3 {
public static final int driveMotorID = 3;
public static final int angleMotorID = 53;
public static final int canCoderID = 4;
public static final double angleOffset = 32.695;
public static final double angleOffset = 31.816;
public static final SwerveModuleConstants constants =
new SwerveModuleConstants(driveMotorID, angleMotorID, canCoderID, angleOffset);
}
Expand All @@ -144,18 +143,6 @@ public static final class Mod3 {
* Autonomous constants for swerve bot.
*/
public static final class AutoConstants {
public static final double kMaxSpeedMetersPerSecond = 1;
public static final double kMaxAccelerationMetersPerSecondSquared = 1;
public static final double kMaxAngularSpeedRadiansPerSecond = Math.PI;
public static final double kMaxAngularSpeedRadiansPerSecondSquared = Math.PI;

public static final double kPXController = 1;
public static final double kPYController = 1;
public static final double kPThetaController = 1;

// Constraint for the motion profilied robot angle controller
public static final TrapezoidProfile.Constraints kThetaControllerConstraints =
new TrapezoidProfile.Constraints(kMaxAngularSpeedRadiansPerSecond,
kMaxAngularSpeedRadiansPerSecondSquared);

}
}
20 changes: 1 addition & 19 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import frc.robot.autos.ResnickAuto;
import frc.robot.commands.TeleopSwerve;
import frc.robot.subsystems.Swerve;

Expand All @@ -27,28 +26,14 @@ public class RobotContainer {

private final SendableChooser<Command> autoChooser = new SendableChooser<>();

private static final String resnickAuto = "Resnick Auto";


/* Drive Controls */

/* Driver Buttons */


boolean fieldRelative;
boolean openLoop;


/* Subsystems */
private final Swerve s_Swerve = new Swerve();

/** The container for the robot. Contains subsystems, OI devices, and commands. */
public RobotContainer() {
this.fieldRelative = Constants.Swerve.isFieldRelative;
this.openLoop = Constants.Swerve.isOpenLoop;
s_Swerve.setDefaultCommand(new TeleopSwerve(s_Swerve, driver,
Constants.Swerve.isFieldRelative, Constants.Swerve.isOpenLoop));
autoChooser.addOption(resnickAuto, new ResnickAuto(s_Swerve));
// autoChooser.addOption(resnickAuto, new ResnickAuto(s_Swerve));
SmartDashboard.putData("Choose Auto: ", autoChooser);
// Configure the button bindings
configureButtonBindings();
Expand All @@ -72,9 +57,6 @@ private void configureButtonBindings() {
*/

public Command getAutonomousCommand() {



return autoChooser.getSelected();

}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/frc/robot/SwerveModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import edu.wpi.first.math.kinematics.SwerveModulePosition;
import edu.wpi.first.math.kinematics.SwerveModuleState;
import frc.lib.math.Conversions;
import frc.lib.util.CTREModuleState;

/**
* Base Swerve Module Class. Creates an instance of the swerve module
Expand Down
26 changes: 0 additions & 26 deletions src/main/java/frc/robot/SwerveModuleConstants.java

This file was deleted.

Empty file.
57 changes: 0 additions & 57 deletions src/main/java/frc/robot/autos/ExampleAuto.java

This file was deleted.

79 changes: 0 additions & 79 deletions src/main/java/frc/robot/autos/LimelightAuto.java

This file was deleted.

38 changes: 0 additions & 38 deletions src/main/java/frc/robot/autos/ResnickAuto.java

This file was deleted.

Loading

0 comments on commit 71c8c98

Please sign in to comment.