Skip to content

Commit

Permalink
fix: module offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
mimizh2418 committed Jan 11, 2024
1 parent e928fcd commit 884bb1a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/main/java/org/team1540/robot2024/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ public void disabledPeriodic() {
@Override
public void autonomousInit() {
autonomousCommand = robotContainer.getAutonomousCommand();
robotContainer.drive.setPose(PathPlannerAuto.getStaringPoseFromAutoFile("TestAuto"));
// schedule the autonomous command (example)
if (autonomousCommand != null) {
autonomousCommand.schedule();
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/org/team1540/robot2024/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ public RobotContainer() {
drive =
new Drive(
new GyroIONavx(),
new ModuleIOTalonFX(SwerveFactory.getModuleMotors(1, SwerveFactory.SwerveCorner.FRONT_LEFT)),
new ModuleIOTalonFX(SwerveFactory.getModuleMotors(7, SwerveFactory.SwerveCorner.FRONT_RIGHT)),
new ModuleIOTalonFX(SwerveFactory.getModuleMotors(4, SwerveFactory.SwerveCorner.BACK_LEFT)),
new ModuleIOTalonFX(SwerveFactory.getModuleMotors(3, SwerveFactory.SwerveCorner.BACK_RIGHT)));
new ModuleIOTalonFX(SwerveFactory.getModuleMotors(3, SwerveFactory.SwerveCorner.FRONT_LEFT)),
new ModuleIOTalonFX(SwerveFactory.getModuleMotors(4, SwerveFactory.SwerveCorner.FRONT_RIGHT)),
new ModuleIOTalonFX(SwerveFactory.getModuleMotors(7, SwerveFactory.SwerveCorner.BACK_LEFT)),
new ModuleIOTalonFX(SwerveFactory.getModuleMotors(1, SwerveFactory.SwerveCorner.BACK_RIGHT)));
// drive = new Drive(
// new GyroIOPigeon2(),
// new ModuleIOTalonFX(0),
Expand All @@ -59,8 +59,7 @@ public RobotContainer() {
// Sim robot, instantiate physics sim IO implementations
drive =
new Drive(
new GyroIO() {
},
new GyroIO() {},
new ModuleIOSim(),
new ModuleIOSim(),
new ModuleIOSim(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public Module(ModuleIO io, int index) {
}

public void periodic() {
System.out.println(driveFeedback.getP() + " " + driveFeedback.getI() + " " + driveFeedback.getD());
io.updateInputs(inputs);
Logger.processInputs("Drive/Module" + index, inputs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

public class SwerveFactory {
private static final double[] moduleOffsetsRots = new double[]{
-0.4130859, // Module 1
-0.9130859, // Module 1
0.0, // Module 2
-0.2197265, // Module 3
-0.7197265, // Module 3
-0.7722, // Module 4
0.0, // Module 5
0.0, // Module 6
Expand All @@ -27,10 +27,10 @@ public static SwerveModuleHW getModuleMotors(int id, SwerveCorner corner) {
}

public enum SwerveCorner {
FRONT_LEFT(180),
FRONT_LEFT(0),
FRONT_RIGHT(90),
BACK_LEFT(270),
BACK_RIGHT(0);
BACK_RIGHT(180);

private final double offset;
SwerveCorner(double offset) {
Expand Down

0 comments on commit 884bb1a

Please sign in to comment.