VEX IQ Python API
Public Member Functions | List of all members
vex.Gyro Class Reference
Inheritance diagram for vex.Gyro:
vex.Device

Public Member Functions

def __init__ (self, index, calibrate=True)
 
def start_calibration (self, gyroCalibrationType=GyroCalibrationType.QUICK, waitForCompletion=True)
 Starts recalibration of the gyro. More...
 
def is_calibrating (self)
 Returns True while the gyro sensor is performing a requested recalibration, changing to false once recalibration has completed. More...
 
def set_heading (self, value=0, rotationUnits=RotationUnits.DEG)
 Set the gyro sensor angle to angle. More...
 
def set_rotation (self, value=0, rotationUnits=RotationUnits.DEG)
 Set the gyro sensor rotation to angle. More...
 
def heading (self, rotationUnits=RotationUnits.DEG)
 Gets the angle of the gyro sensor. More...
 
def rotation (self, rotationUnits=RotationUnits.DEG)
 Gets the absolute angle of the gyro sensor. More...
 

Detailed Description

 @brief Creates a new gyro object on the port specified in the parameter.
 @param index to the brain port.
 @param calibrate set to calibrate the sensor now

Constructor & Destructor Documentation

◆ __init__()

def vex.Gyro.__init__ (   self,
  index,
  calibrate = True 
)

Member Function Documentation

◆ start_calibration()

def vex.Gyro.start_calibration (   self,
  gyroCalibrationType = GyroCalibrationType.QUICK,
  waitForCompletion = True 
)

Starts recalibration of the gyro.

Parameters
gyroCalibrationTypeamount of time for calibration, GyroCalibrationType enum value.
waitForCompletionwait for calibration to complete

◆ is_calibrating()

def vex.Gyro.is_calibrating (   self)

Returns True while the gyro sensor is performing a requested recalibration, changing to false once recalibration has completed.

Returns
Returns True if gyro is still calibrating.

◆ set_heading()

def vex.Gyro.set_heading (   self,
  value = 0,
  rotationUnits = RotationUnits.DEG 
)

Set the gyro sensor angle to angle.

Parameters
valueThe new heading for the gyro
rotationUnitsThe rotation unit for the heading

◆ set_rotation()

def vex.Gyro.set_rotation (   self,
  value = 0,
  rotationUnits = RotationUnits.DEG 
)

Set the gyro sensor rotation to angle.

Parameters
valueThe new absolute angle for the gyro
rotationUnitsThe rotation unit for the angle

◆ heading()

def vex.Gyro.heading (   self,
  rotationUnits = RotationUnits.DEG 
)

Gets the angle of the gyro sensor.

Parameters
rotationUnitsThe measurement unit for the gyro device.

◆ rotation()

def vex.Gyro.rotation (   self,
  rotationUnits = RotationUnits.DEG 
)

Gets the absolute angle of the gyro sensor.

Parameters
rotationUnitsThe measurement unit for the gyro device.