Update RobotGyro.java

This commit is contained in:
Astatin3
2023-01-10 18:54:58 -07:00
parent 50914581ca
commit 9d59fdef65
+14 -1
View File
@@ -28,6 +28,11 @@ public class RobotGyro implements Gyro {
private double m_lastPigeonAngle; private double m_lastPigeonAngle;
private double m_deltaPigeonAngle; private double m_deltaPigeonAngle;
private double diff_Pitch = 0;
private double diff_Yaw = 0;
private double diff_Roll = 0;
/** /**
* Creates a Gyro based on a pigeon * Creates a Gyro based on a pigeon
* @param gyro the gyroscope to use for Gyro * @param gyro the gyroscope to use for Gyro
@@ -46,6 +51,12 @@ public class RobotGyro implements Gyro {
m_isGyroAPigeon = false; m_isGyroAPigeon = false;
} }
// Sets a
//
public void ResetAng() {
}
/** /**
* Run in periodic if you are using a pigeon. Updates a delta angle so that it can calculate getRate(). Note * Run in periodic if you are using a pigeon. Updates a delta angle so that it can calculate getRate(). Note
* that the getRate() method for a navX will likely be much more accurate than for a pigeon. * that the getRate() method for a navX will likely be much more accurate than for a pigeon.
@@ -100,7 +111,9 @@ public class RobotGyro implements Gyro {
*/ */
private double[] getPigeonAngles() { private double[] getPigeonAngles() {
double[] angles = new double[3]; double[] angles = new double[3];
m_pigeon.getYawPitchRoll(angles); m_pigeon.getPitch(angles);
m_pigeon.getYaw(angles);
m_pigeon.getRoll(angles);
return angles; return angles;
} }