mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[wpilib] Rename OnboardIMU constants to all caps
This commit is contained in:
@@ -31,7 +31,7 @@ public class Drivetrain {
|
||||
private final Encoder m_leftEncoder = new Encoder(0, 1);
|
||||
private final Encoder m_rightEncoder = new Encoder(2, 3);
|
||||
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.kFlat);
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.FLAT);
|
||||
|
||||
private final PIDController m_leftPIDController = new PIDController(1, 0, 0);
|
||||
private final PIDController m_rightPIDController = new PIDController(1, 0, 0);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class Drivetrain {
|
||||
private final Encoder m_leftEncoder = new Encoder(0, 1);
|
||||
private final Encoder m_rightEncoder = new Encoder(2, 3);
|
||||
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.kFlat);
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.FLAT);
|
||||
|
||||
private final PIDController m_leftPIDController = new PIDController(1, 0, 0);
|
||||
private final PIDController m_rightPIDController = new PIDController(1, 0, 0);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Robot extends TimedRobot {
|
||||
private static final int kLeftMotorPort = 0;
|
||||
private static final int kRightMotorPort = 1;
|
||||
private static final OnboardIMU.MountOrientation kIMUMountOrientation =
|
||||
OnboardIMU.MountOrientation.kFlat;
|
||||
OnboardIMU.MountOrientation.FLAT;
|
||||
private static final int kJoystickPort = 0;
|
||||
|
||||
private final PWMSparkMax m_leftDrive = new PWMSparkMax(kLeftMotorPort);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Drivetrain {
|
||||
private final PIDController m_backLeftPIDController = new PIDController(1, 0, 0);
|
||||
private final PIDController m_backRightPIDController = new PIDController(1, 0, 0);
|
||||
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.kFlat);
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.FLAT);
|
||||
|
||||
private final MecanumDriveKinematics m_kinematics =
|
||||
new MecanumDriveKinematics(
|
||||
|
||||
@@ -21,7 +21,7 @@ public class Robot extends TimedRobot {
|
||||
private static final int kFrontRightChannel = 2;
|
||||
private static final int kRearRightChannel = 3;
|
||||
private static final OnboardIMU.MountOrientation kIMUMountOrientation =
|
||||
OnboardIMU.MountOrientation.kFlat;
|
||||
OnboardIMU.MountOrientation.FLAT;
|
||||
private static final int kJoystickPort = 0;
|
||||
|
||||
private final MecanumDrive m_robotDrive;
|
||||
|
||||
@@ -45,7 +45,7 @@ public class Drivetrain {
|
||||
private final PIDController m_backLeftPIDController = new PIDController(1, 0, 0);
|
||||
private final PIDController m_backRightPIDController = new PIDController(1, 0, 0);
|
||||
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.kFlat);
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.FLAT);
|
||||
|
||||
private final MecanumDriveKinematics m_kinematics =
|
||||
new MecanumDriveKinematics(
|
||||
|
||||
@@ -49,7 +49,7 @@ public class Drive extends SubsystemBase {
|
||||
DriveConstants.kRightEncoderPorts[1],
|
||||
DriveConstants.kRightEncoderReversed);
|
||||
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.kFlat);
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.FLAT);
|
||||
private final ProfiledPIDController m_controller =
|
||||
new ProfiledPIDController(
|
||||
DriveConstants.kTurnP,
|
||||
|
||||
@@ -45,7 +45,7 @@ public class Drivetrain {
|
||||
private final PIDController m_leftPIDController = new PIDController(8.5, 0, 0);
|
||||
private final PIDController m_rightPIDController = new PIDController(8.5, 0, 0);
|
||||
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.kFlat);
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.FLAT);
|
||||
|
||||
private final DifferentialDriveKinematics m_kinematics =
|
||||
new DifferentialDriveKinematics(kTrackwidth);
|
||||
|
||||
@@ -26,7 +26,7 @@ public class Drivetrain {
|
||||
private final SwerveModule m_backLeft = new SwerveModule(5, 6, 8, 9, 10, 11);
|
||||
private final SwerveModule m_backRight = new SwerveModule(7, 8, 12, 13, 14, 15);
|
||||
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.kFlat);
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.FLAT);
|
||||
|
||||
private final SwerveDriveKinematics m_kinematics =
|
||||
new SwerveDriveKinematics(
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Drivetrain {
|
||||
private final SwerveModule m_backLeft = new SwerveModule(5, 6, 8, 9, 10, 11);
|
||||
private final SwerveModule m_backRight = new SwerveModule(7, 8, 12, 13, 14, 15);
|
||||
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.kFlat);
|
||||
private final OnboardIMU m_imu = new OnboardIMU(OnboardIMU.MountOrientation.FLAT);
|
||||
|
||||
private final SwerveDriveKinematics m_kinematics =
|
||||
new SwerveDriveKinematics(
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.wpilib.smartdashboard.SmartDashboard;
|
||||
public class Robot extends TimedRobot {
|
||||
double m_prevXAccel;
|
||||
double m_prevYAccel;
|
||||
OnboardIMU m_accelerometer = new OnboardIMU(MountOrientation.kFlat);
|
||||
OnboardIMU m_accelerometer = new OnboardIMU(MountOrientation.FLAT);
|
||||
|
||||
@Override
|
||||
public void robotPeriodic() {
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.wpilib.smartdashboard.SmartDashboard;
|
||||
* https://docs.wpilib.org/en/stable/docs/software/hardware-apis/sensors/accelerometers-software.html
|
||||
*/
|
||||
public class Robot extends TimedRobot {
|
||||
OnboardIMU m_accelerometer = new OnboardIMU(MountOrientation.kFlat);
|
||||
OnboardIMU m_accelerometer = new OnboardIMU(MountOrientation.FLAT);
|
||||
// Create a LinearFilter that will calculate a moving average of the measured X acceleration over
|
||||
// the past 10 iterations of the main loop
|
||||
LinearFilter m_xAccelFilter = LinearFilter.movingAverage(10);
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.wpilib.hardware.imu.OnboardIMU.MountOrientation;
|
||||
*/
|
||||
public class Robot extends TimedRobot {
|
||||
// Creates an object for the on board IMU
|
||||
OnboardIMU m_iMU = new OnboardIMU(MountOrientation.kFlat);
|
||||
OnboardIMU m_iMU = new OnboardIMU(MountOrientation.FLAT);
|
||||
|
||||
/** Called once at the beginning of the robot program. */
|
||||
public Robot() {}
|
||||
|
||||
Reference in New Issue
Block a user