mirror of
https://github.com/Team4388/2023WayOfTheRobot.git
synced 2026-06-09 08:38:02 -06:00
imported dependencies, mocks gone, code builds
This commit is contained in:
@@ -80,6 +80,6 @@ public class DiffDrive extends SubsystemBase {
|
||||
SmartDashboard.putBoolean("Is Gyro a Pigeon?", m_gyro.m_isGyroAPigeon);
|
||||
SmartDashboard.putNumber("Turn Rate", m_gyro.getRate());
|
||||
SmartDashboard.putNumber("Gyro Pitch", m_gyro.getPitch());
|
||||
SmartDashboard.putData(m_gyro);
|
||||
// SmartDashboard.putData(m_gyro);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,13 +11,14 @@ import com.ctre.phoenix.sensors.PigeonIMU;
|
||||
import com.ctre.phoenix.sensors.PigeonIMU.CalibrationMode;
|
||||
import com.kauailabs.navx.frc.AHRS;
|
||||
|
||||
import edu.wpi.first.wpilibj.GyroBase;
|
||||
// import edu.wpi.first.wpilibj.GyroBase;
|
||||
import edu.wpi.first.wpilibj.interfaces.Gyro;
|
||||
import edu.wpi.first.math.MathUtil;
|
||||
|
||||
/**
|
||||
* Gyro class that allows for interchangeable use between a pigeon and a navX
|
||||
*/
|
||||
public class RobotGyro extends GyroBase {
|
||||
public class RobotGyro implements Gyro {
|
||||
private RobotTime m_robotTime = RobotTime.getInstance();
|
||||
|
||||
private PigeonIMU m_pigeon = null;
|
||||
|
||||
@@ -32,7 +32,7 @@ public class XboxTriggerButton extends Button {
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
// @Override
|
||||
public boolean get() {
|
||||
if (m_trigger == RIGHT_TRIGGER) {
|
||||
return m_controller.getRightTrigger();
|
||||
|
||||
+8
-6
@@ -7,12 +7,14 @@
|
||||
|
||||
package frc4388.robot.subsystems;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
// import static org.junit.Assert.assertEquals;
|
||||
// import static org.mockito.Mockito.mock;
|
||||
// import org.junit.Test;
|
||||
|
||||
import edu.wpi.first.wpilibj.*;
|
||||
import edu.wpi.first.wpilibj.motorcontrol.Spark;
|
||||
import frc4388.robot.Constants.LEDConstants;
|
||||
import frc4388.utility.LEDPatterns;
|
||||
|
||||
@@ -23,7 +25,7 @@ public class LEDSubsystemTest {
|
||||
@Test
|
||||
public void testConstructor() {
|
||||
// Arrange
|
||||
Spark ledController = mock(Spark.class);
|
||||
Spark ledController = new Spark(0);
|
||||
|
||||
// Act
|
||||
LED led = new LED(ledController);
|
||||
@@ -35,7 +37,7 @@ public class LEDSubsystemTest {
|
||||
@Test
|
||||
public void testPatterns() {
|
||||
// Arrange
|
||||
Spark ledController = mock(Spark.class);
|
||||
Spark ledController = new Spark(0);
|
||||
LED led = new LED(ledController);
|
||||
|
||||
// Act
|
||||
+6
-5
@@ -7,13 +7,14 @@
|
||||
|
||||
package frc4388.utility;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
// import static org.junit.Assert.*;
|
||||
// import static org.mockito.Mockito.*;
|
||||
|
||||
import com.kauailabs.navx.frc.AHRS;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import frc4388.mocks.MockPigeonIMU;
|
||||
import frc4388.robot.Constants.DriveConstants;
|
||||
|
||||
@@ -30,7 +31,7 @@ public class RobotGyroUtilityTest {
|
||||
public void testConstructor() {
|
||||
// Arrange
|
||||
MockPigeonIMU pigeon = new MockPigeonIMU(DriveConstants.DRIVE_PIGEON_ID);
|
||||
AHRS navX = mock(AHRS.class);
|
||||
AHRS navX = new AHRS();
|
||||
gyroPigeon = new RobotGyro(pigeon);
|
||||
gyroNavX = new RobotGyro(navX);
|
||||
|
||||
+3
-2
@@ -7,9 +7,10 @@
|
||||
|
||||
package frc4388.utility;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.*;
|
||||
// import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Add your docs here.
|
||||
Reference in New Issue
Block a user