Skip to content

Commit

Permalink
add fallibles in flexmodule
Browse files Browse the repository at this point in the history
  • Loading branch information
Yxhej committed Jan 17, 2024
1 parent 2214ba1 commit c672b0a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/sciborgs1155/robot/drive/FlexModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.revrobotics.SparkAbsoluteEncoder.Type;
import edu.wpi.first.math.geometry.Rotation2d;
import java.util.Set;
import org.sciborgs1155.lib.FaultLogger;
import org.sciborgs1155.lib.SparkUtils;
import org.sciborgs1155.lib.SparkUtils.Data;
import org.sciborgs1155.lib.SparkUtils.Sensor;
Expand Down Expand Up @@ -68,6 +69,9 @@ public FlexModule(int drivePort, int turnPort, Rotation2d angularOffset) {
Set.of(Sensor.DUTY_CYCLE),
false);

FaultLogger.register(driveMotor);
FaultLogger.register(turnMotor);

driveMotor.burnFlash();
turnMotor.burnFlash();

Expand Down
26 changes: 11 additions & 15 deletions src/test/java/org/sciborgs1155/robot/SwerveTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@

import static org.sciborgs1155.lib.TestingUtil.*;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.sciborgs1155.robot.drive.Drive;

/** Swerve test. Currently incomplete and does nothing. */
public class SwerveTest {
Drive drive;
// Drive drive;

@BeforeEach
public void setup() {
setupHAL();
drive = Drive.create();
}
// @BeforeEach
// public void setup() {
// setupHAL();
// drive = Drive.create();
// }

@Test
public void reachSetpoint() {
run(drive.drive(() -> 1, () -> 1, () -> 1));
fastForward();
}
// @Test
// public void reachSetpoint() {
// run(drive.drive(() -> 1, () -> 1, () -> 1));
// fastForward();
// }
}

0 comments on commit c672b0a

Please sign in to comment.