TeamCode / org.firstinspires.ftc.teamcode.sensing / IMUGyro

IMUGyro

class IMUGyro : Gyro

A Gyro instance that uses the REV Robotic Expansion's built-in gyro sensor (IMU) to obtain measurements.

Types

Companion

companion object Companion : Factory<IMUGyro>

Constructors

<init>

IMUGyro(imu: BNO055IMU, parameters: Parameters)

A Gyro instance that uses the REV Robotic Expansion's built-in gyro sensor (IMU) to obtain measurements.

Properties

angleModifier

val angleModifier: Double

A number which all gyro measurements are multiplied by. Used to ensure that getAbsoluteAngle() conforms to the spec laid out in Gyro. You don't need to know how this works to use IMUGyro.

imu

val imu: BNO055IMU

isCalibrated

val isCalibrated: Boolean

Whether the gyro has been successfully calibrated. See GyroTestOpMode for a demonstration of how to wait for a gyro to calibrate.

parameters

val parameters: Parameters

Functions

calibrate

fun calibrate(): Unit

Calibrates the gyro, or begins the calibration process. Usually called immediately after initialize. Implementation details vary by specific gyro sensor. In some cases, you may have to wait a few seconds before the gyro is calibrated. See isCalibrated.

getAbsoluteAngle

fun getAbsoluteAngle(): Double

Returns the angle that the robot is facing.

initialize

fun initialize(): Unit

Initializes the gyro. Usually called in an op mode's init phase. Implementation details vary by specific gyro sensor.

Companion Object Properties

IMU_NAME

val IMU_NAME: String

IMU_PARAMETERS

val IMU_PARAMETERS: Parameters

Companion Object Functions

standard

fun standard(hardwareMap: HardwareMap): IMUGyro