Package lib.custom.sensors
Interface IMU
- All Known Implementing Classes:
CustomNavx,CustomPigeon
public interface IMU
-
Method Summary
Modifier and TypeMethodDescriptiondoublegetPitch()doublegetRoll()default edu.wpi.first.math.geometry.Rotation2ddefault edu.wpi.first.math.geometry.Rotation3ddoubleGet current hardware temperature in freedom units (°F)doublegetYaw()static doublewrapAngleHalf(double angle) Wrap an angle in rotations to the range [-1/2, 1/2)static doublewrapAnglePositive(double angle) Wrap an angle in rotations to the range [0, 1)default voidzeroYaw()Set the zero position to the current yawvoidzeroYaw(double offset) Set the current yaw to the provided rotation
-
Method Details
-
wrapAnglePositive
static double wrapAnglePositive(double angle) Wrap an angle in rotations to the range [0, 1) -
wrapAngleHalf
static double wrapAngleHalf(double angle) Wrap an angle in rotations to the range [-1/2, 1/2) -
getYaw
double getYaw()- Returns:
- current yaw in rotations; positive = counterclockwise
-
getPitch
double getPitch()- Returns:
- current pitch in rotations; positive = front up
-
getRoll
double getRoll()- Returns:
- current roll in rotations; positive = left side up, right side down
-
getRotation2d
default edu.wpi.first.math.geometry.Rotation2d getRotation2d()- Returns:
- current yaw as a
Rotation2d
-
getRotation3d
default edu.wpi.first.math.geometry.Rotation3d getRotation3d()- Returns:
- current rotation as a
Rotation3d
-
zeroYaw
default void zeroYaw()Set the zero position to the current yaw -
zeroYaw
void zeroYaw(double offset) Set the current yaw to the provided rotation -
getTemperature
double getTemperature()Get current hardware temperature in freedom units (°F)
-