mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal, wpilib] Remove built in accelerometer (#7702)
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
package edu.wpi.first.wpilibj.examples.romireference.subsystems;
|
||||
|
||||
import edu.wpi.first.util.sendable.SendableRegistry;
|
||||
import edu.wpi.first.wpilibj.BuiltInAccelerometer;
|
||||
import edu.wpi.first.wpilibj.Encoder;
|
||||
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
|
||||
import edu.wpi.first.wpilibj.motorcontrol.Spark;
|
||||
@@ -33,9 +32,6 @@ public class Drivetrain extends SubsystemBase {
|
||||
// Set up the RomiGyro
|
||||
private final RomiGyro m_gyro = new RomiGyro();
|
||||
|
||||
// Set up the BuiltInAccelerometer
|
||||
private final BuiltInAccelerometer m_accelerometer = new BuiltInAccelerometer();
|
||||
|
||||
/** Creates a new Drivetrain. */
|
||||
public Drivetrain() {
|
||||
SendableRegistry.addChild(m_diffDrive, m_leftMotor);
|
||||
@@ -81,33 +77,6 @@ public class Drivetrain extends SubsystemBase {
|
||||
return (getLeftDistanceInch() + getRightDistanceInch()) / 2.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* The acceleration in the X-axis.
|
||||
*
|
||||
* @return The acceleration of the Romi along the X-axis in Gs
|
||||
*/
|
||||
public double getAccelX() {
|
||||
return m_accelerometer.getX();
|
||||
}
|
||||
|
||||
/**
|
||||
* The acceleration in the Y-axis.
|
||||
*
|
||||
* @return The acceleration of the Romi along the Y-axis in Gs
|
||||
*/
|
||||
public double getAccelY() {
|
||||
return m_accelerometer.getY();
|
||||
}
|
||||
|
||||
/**
|
||||
* The acceleration in the Z-axis.
|
||||
*
|
||||
* @return The acceleration of the Romi along the Z-axis in Gs
|
||||
*/
|
||||
public double getAccelZ() {
|
||||
return m_accelerometer.getZ();
|
||||
}
|
||||
|
||||
/**
|
||||
* Current angle of the Romi around the X-axis.
|
||||
*
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
package edu.wpi.first.wpilibj.examples.xrpreference.subsystems;
|
||||
|
||||
import edu.wpi.first.util.sendable.SendableRegistry;
|
||||
import edu.wpi.first.wpilibj.BuiltInAccelerometer;
|
||||
import edu.wpi.first.wpilibj.Encoder;
|
||||
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
|
||||
import edu.wpi.first.wpilibj.xrp.XRPGyro;
|
||||
@@ -36,9 +35,6 @@ public class Drivetrain extends SubsystemBase {
|
||||
// Set up the XRPGyro
|
||||
private final XRPGyro m_gyro = new XRPGyro();
|
||||
|
||||
// Set up the BuiltInAccelerometer
|
||||
private final BuiltInAccelerometer m_accelerometer = new BuiltInAccelerometer();
|
||||
|
||||
/** Creates a new Drivetrain. */
|
||||
public Drivetrain() {
|
||||
SendableRegistry.addChild(m_diffDrive, m_leftMotor);
|
||||
@@ -84,33 +80,6 @@ public class Drivetrain extends SubsystemBase {
|
||||
return (getLeftDistanceInch() + getRightDistanceInch()) / 2.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* The acceleration in the X-axis.
|
||||
*
|
||||
* @return The acceleration of the XRP along the X-axis in Gs
|
||||
*/
|
||||
public double getAccelX() {
|
||||
return m_accelerometer.getX();
|
||||
}
|
||||
|
||||
/**
|
||||
* The acceleration in the Y-axis.
|
||||
*
|
||||
* @return The acceleration of the XRP along the Y-axis in Gs
|
||||
*/
|
||||
public double getAccelY() {
|
||||
return m_accelerometer.getY();
|
||||
}
|
||||
|
||||
/**
|
||||
* The acceleration in the Z-axis.
|
||||
*
|
||||
* @return The acceleration of the XRP along the Z-axis in Gs
|
||||
*/
|
||||
public double getAccelZ() {
|
||||
return m_accelerometer.getZ();
|
||||
}
|
||||
|
||||
/**
|
||||
* Current angle of the XRP around the X-axis.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user