vex.gyro_sensor package¶
VEX Gyro Sensor.
- class vex.gyro_sensor.Gyro(index: Ports, calibrate: bool = True)[source]¶
Bases:
DeviceGyro Sensor.
ROBOT MESH PYTHON B:
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_gyro.html
- heading(rotationUnits: RotationUnits = RotationUnits.DEG) float[source]¶
Return Gyro Heading Angle Value.
ROBOT MESH PYTHON B:
Get the angle of the gyro sensor.
Parameters: - rotationUnits: The measurement unit for the gyro device.
- is_calibrating() bool[source]¶
Check if Gyro Sensor is calibrating.
ROBOT MESH PYTHON B:
Return True while gyro sensor is performing a requested recalibration.
(changing to false once recalibration has completed)
Returns True if gyro is still calibrating.
- rotation(rotationUnits: RotationUnits = RotationUnits.DEG) float[source]¶
Return Gyro Cumulative Rotation Angle Value.
ROBOT MESH PYTHON B:
Get the absolute angle of the gyro sensor.
Parameters: - rotationUnits: The measurement unit for the gyro device.
- set_heading(value: float = 0, rotationUnits: RotationUnits = RotationUnits.DEG)[source]¶
Set Gyro Heading Angle Value.
ROBOT MESH PYTHON B:
Set the gyro sensor angle to angle.
Parameters: - value: The new heading for the gyro - rotationUnits: The rotation unit for the heading
- set_rotation(value: float = 0, rotationUnits: RotationUnits = RotationUnits.DEG)[source]¶
Set Gyro Cumulative Rotation Angle Value.
ROBOT MESH PYTHON B:
Set the gyro sensor rotation to angle.
Parameters: - value: The new absolute angle for the gyro - rotationUnits: The rotation unit for the angle
- start_calibration(gyroCalibrationType: GyroCalibrationType = GyroCalibrationType.QUICK, waitForCompletion: bool = True)[source]¶
Start calibrating Gyro Sensor.
ROBOT MESH PYTHON B:
Start recalibration of the gyro.
Parameters: - gyroCalibrationType: amount of time for calibration,
GyroCalibrationType enum value.
waitForCompletion: wait for calibration to complete
- class vex.gyro_sensor.GyroCalibrationType(value)[source]¶
Bases:
IntEnumGyro Calibration Types.
ROBOT MESH PYTHON B:
robotmesh.com/studio/content/docs/vexiq-python_b/html/classvex_1_1_gyro_calibration_type.html
- ACCURATE: int = 2¶
- QUICK: int = 0¶
- SLOW: int = 1¶