[wpilibj] Fix Gyro.getRotation2d() units bug (#2594)

The new getRotation2d() method in the Gyro interface was passing
an angle in degrees to a constructor that accepts radians.
Use fromDegrees() factory function instead.
This commit is contained in:
Prateek Machiraju
2020-07-12 12:31:15 -04:00
committed by GitHub
parent 3005803598
commit 33f7dec5cf

View File

@@ -74,6 +74,6 @@ public interface Gyro extends AutoCloseable {
* {@link edu.wpi.first.wpilibj.geometry.Rotation2d}.
*/
default Rotation2d getRotation2d() {
return new Rotation2d(-getAngle());
return Rotation2d.fromDegrees(-getAngle());
}
}