mirror of
https://github.com/TimeCrafters/FTC_2022
synced 2025-12-16 20:32:35 +00:00
Make Robot#facing return 360 degree rotation
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user