mirror of
https://github.com/Team4388/2023WayOfTheRobot.git
synced 2026-06-09 00:37:59 -06:00
Update RobotGyro.java
This commit is contained in:
@@ -28,8 +28,8 @@ 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_Yaw = 0;
|
||||||
|
private double diff_Pitch = 0;
|
||||||
private double diff_Roll = 0;
|
private double diff_Roll = 0;
|
||||||
|
|
||||||
|
|
||||||
@@ -54,7 +54,9 @@ public class RobotGyro implements Gyro {
|
|||||||
// Sets a
|
// Sets a
|
||||||
//
|
//
|
||||||
public void ResetAng() {
|
public void ResetAng() {
|
||||||
|
diff_Yaw = m_pigeon.getYaw();
|
||||||
|
diff_Pitch = m_pigeon.getPitch();
|
||||||
|
diff_Roll = m_pigeon.getRoll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -110,11 +112,10 @@ public class RobotGyro implements Gyro {
|
|||||||
* Roll is within [-90,+90] degrees.
|
* Roll is within [-90,+90] degrees.
|
||||||
*/
|
*/
|
||||||
private double[] getPigeonAngles() {
|
private double[] getPigeonAngles() {
|
||||||
double[] angles = new double[3];
|
double yaw = m_pigeon.getYaw();
|
||||||
m_pigeon.getPitch(angles);
|
double pitch = m_pigeon.getPitch();
|
||||||
m_pigeon.getYaw(angles);
|
double roll = m_pigeon.getRoll();
|
||||||
m_pigeon.getRoll(angles);
|
return double[(yaw - diff_Yaw), (pitch - diff_Pitch), (roll - diff_Roll)];
|
||||||
return angles;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user