Class TiltSensor
- java.lang.Object
-
- com.thegongoliers.input.orientation.TiltSensor
-
public class TiltSensor extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TiltSensor(edu.wpi.first.wpilibj.interfaces.Accelerometer accel)
Converts an accelerometer reading to tilt.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calibrate()
Calibrate the tilt sensor by setting the current pitch and roll as the zero position.double
getPitch()
Calculates the pitch.double
getRoll()
Calculates the roll.
-
-
-
Method Detail
-
calibrate
public void calibrate()
Calibrate the tilt sensor by setting the current pitch and roll as the zero position.
-
getRoll
public double getRoll()
Calculates the roll.- Returns:
- The roll in degrees.
-
getPitch
public double getPitch()
Calculates the pitch.- Returns:
- The pitch in degrees.
-
-