mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[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:
committed by
GitHub
parent
3005803598
commit
33f7dec5cf
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user