mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal, wpilib] Remove built in accelerometer (#7702)
This commit is contained in:
@@ -63,18 +63,6 @@ units::meter_t Drivetrain::GetAverageDistance() {
|
||||
return (GetLeftDistance() + GetRightDistance()) / 2.0;
|
||||
}
|
||||
|
||||
units::meters_per_second_squared_t Drivetrain::GetAccelX() {
|
||||
return units::meters_per_second_squared_t{m_accelerometer.GetX()};
|
||||
}
|
||||
|
||||
units::meters_per_second_squared_t Drivetrain::GetAccelY() {
|
||||
return units::meters_per_second_squared_t{m_accelerometer.GetY()};
|
||||
}
|
||||
|
||||
units::meters_per_second_squared_t Drivetrain::GetAccelZ() {
|
||||
return units::meters_per_second_squared_t{m_accelerometer.GetZ()};
|
||||
}
|
||||
|
||||
units::radian_t Drivetrain::GetGyroAngleX() {
|
||||
return m_gyro.GetAngleX();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc/BuiltInAccelerometer.h>
|
||||
#include <frc/Encoder.h>
|
||||
#include <frc/drive/DifferentialDrive.h>
|
||||
#include <frc/motorcontrol/Spark.h>
|
||||
@@ -74,27 +73,6 @@ class Drivetrain : public frc2::SubsystemBase {
|
||||
*/
|
||||
units::meter_t GetAverageDistance();
|
||||
|
||||
/**
|
||||
* The acceleration in the X-axis.
|
||||
*
|
||||
* @return The acceleration of the Romi along the X-axis.
|
||||
*/
|
||||
units::meters_per_second_squared_t GetAccelX();
|
||||
|
||||
/**
|
||||
* The acceleration in the Y-axis.
|
||||
*
|
||||
* @return The acceleration of the Romi along the Y-axis.
|
||||
*/
|
||||
units::meters_per_second_squared_t GetAccelY();
|
||||
|
||||
/**
|
||||
* The acceleration in the Z-axis.
|
||||
*
|
||||
* @return The acceleration of the Romi along the Z-axis.
|
||||
*/
|
||||
units::meters_per_second_squared_t GetAccelZ();
|
||||
|
||||
/**
|
||||
* Current angle of the Romi around the X-axis.
|
||||
*
|
||||
@@ -133,5 +111,4 @@ class Drivetrain : public frc2::SubsystemBase {
|
||||
[&](double output) { m_rightMotor.Set(output); }};
|
||||
|
||||
frc::RomiGyro m_gyro;
|
||||
frc::BuiltInAccelerometer m_accelerometer;
|
||||
};
|
||||
|
||||
@@ -63,18 +63,6 @@ units::meter_t Drivetrain::GetAverageDistance() {
|
||||
return (GetLeftDistance() + GetRightDistance()) / 2.0;
|
||||
}
|
||||
|
||||
units::meters_per_second_squared_t Drivetrain::GetAccelX() {
|
||||
return units::meters_per_second_squared_t{m_accelerometer.GetX()};
|
||||
}
|
||||
|
||||
units::meters_per_second_squared_t Drivetrain::GetAccelY() {
|
||||
return units::meters_per_second_squared_t{m_accelerometer.GetY()};
|
||||
}
|
||||
|
||||
units::meters_per_second_squared_t Drivetrain::GetAccelZ() {
|
||||
return units::meters_per_second_squared_t{m_accelerometer.GetZ()};
|
||||
}
|
||||
|
||||
units::radian_t Drivetrain::GetGyroAngleX() {
|
||||
return m_gyro.GetAngleX();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc/BuiltInAccelerometer.h>
|
||||
#include <frc/Encoder.h>
|
||||
#include <frc/drive/DifferentialDrive.h>
|
||||
#include <frc/xrp/XRPGyro.h>
|
||||
@@ -78,27 +77,6 @@ class Drivetrain : public frc2::SubsystemBase {
|
||||
*/
|
||||
units::meter_t GetAverageDistance();
|
||||
|
||||
/**
|
||||
* The acceleration in the X-axis.
|
||||
*
|
||||
* @return The acceleration of the XRP along the X-axis.
|
||||
*/
|
||||
units::meters_per_second_squared_t GetAccelX();
|
||||
|
||||
/**
|
||||
* The acceleration in the Y-axis.
|
||||
*
|
||||
* @return The acceleration of the XRP along the Y-axis.
|
||||
*/
|
||||
units::meters_per_second_squared_t GetAccelY();
|
||||
|
||||
/**
|
||||
* The acceleration in the Z-axis.
|
||||
*
|
||||
* @return The acceleration of the XRP along the Z-axis.
|
||||
*/
|
||||
units::meters_per_second_squared_t GetAccelZ();
|
||||
|
||||
/**
|
||||
* Current angle of the XRP around the X-axis.
|
||||
*
|
||||
@@ -137,5 +115,4 @@ class Drivetrain : public frc2::SubsystemBase {
|
||||
[&](double output) { m_rightMotor.Set(output); }};
|
||||
|
||||
frc::XRPGyro m_gyro;
|
||||
frc::BuiltInAccelerometer m_accelerometer;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user