Make Robot#facing return 360 degree rotation

This commit is contained in:
2023-01-22 08:47:57 -06:00
parent a5b00b1397
commit 6fea7e69aa

View File

@@ -368,10 +368,10 @@ public class Robot {
throw new RuntimeException("Failed to find variable with name: " + variableName + " in group: Robot, action: Tuning"); throw new RuntimeException("Failed to find variable with name: " + variableName + " in group: Robot, action: Tuning");
} }
// TODO: Convert to 360 degree range with +90 degrees being on the RIGHT
public double facing() { public double facing() {
// FIXME: Apply imuAngleOffset double imuDegrees = imu.getRobotYawPitchRollAngles().getYaw(AngleUnit.DEGREES);
return imu.getRobotYawPitchRollAngles().getYaw(AngleUnit.DEGREES);
return (imuDegrees + imuAngleOffset + 360.0) % 360.0;
} }
public double heading() { public double heading() {