VEX V5 Python API
Public Member Functions | List of all members
vex.Inertial Class Reference

Use the inertial class to control the inertial sensor. More...

Inherits vex.Device.

Public Member Functions

def __init__ (self, index)
 Creates a new inertial object on the port specified. More...
 
def start_calibration (self)
 Starts recalibration of the inertial sensor. More...
 
def is_calibrating (self)
 Returns True while the inertial sensor is performing a requested recalibration, changing to false once recalibration has completed. More...
 
def calibrate (self)
 Recalibration of the inertial sensor. More...
 
def reset_heading (self)
 Reset the heading of the sensor to 0. More...
 
def reset_rotation (self)
 Reset the rotation angle of the sensor to 0. More...
 
def set_heading (self, value, rotationUnits=RotationUnits.DEG)
 brief Set the inertial sensor heading to a new value More...
 
def set_rotation (self, value, rotationUnits=RotationUnits.DEG)
 
def angle (self, rotationUnits=RotationUnits.DEG)
 Gets the angle (yaw angle) of the inertial sensor. More...
 
def roll (self, rotationUnits=RotationUnits.DEG)
 Gets the roll angle of the inertial sensor. More...
 
def pitch (self, rotationUnits=RotationUnits.DEG)
 Gets the pitch angle of the inertial sensor. More...
 
def yaw (self, rotationUnits=RotationUnits.DEG)
 Gets the yaw angle of the inertial sensor. More...
 
def orientation (self, orientationType, rotationUnits=RotationUnits.DEG)
 Gets an orientation angle of the inertial sensor. More...
 
def heading (self, rotationUnits=RotationUnits.DEG)
 Gets the heading (yaw angle as 0-360 deg) of the inertial sensor. More...
 
def rotation (self, rotationUnits=RotationUnits.DEG)
 Gets the absolute angle (yaw angle without limits) of the inertial sensor. More...
 
def gyro_rate (self, axisType, velocityUnits=VelocityUnits.RPM)
 Gets the inertial sensor raw gyro data in specified units. More...
 
def acceleration (self, axisType)
 Gets the inertial sensor raw acceleration data in G. More...
 
def type (self)
 Get the device type. More...
 
def installed (self)
 Gets the status of what is installed. More...
 
def value (self)
 

Detailed Description

Use the inertial class to control the inertial sensor.

Constructor & Destructor Documentation

◆ __init__()

def vex.Inertial.__init__ (   self,
  index 
)

Creates a new inertial object on the port specified.

Parameters
indexThe port index for this motor. The index is zero based.

Reimplemented from vex.Device.

Member Function Documentation

◆ start_calibration()

def vex.Inertial.start_calibration (   self)

Starts recalibration of the inertial sensor.

◆ is_calibrating()

def vex.Inertial.is_calibrating (   self)

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

Returns
True if inertial sensor is still calibrating.

◆ calibrate()

def vex.Inertial.calibrate (   self)

Recalibration of the inertial sensor.

Blocks until calibration is complete.

◆ reset_heading()

def vex.Inertial.reset_heading (   self)

Reset the heading of the sensor to 0.

◆ reset_rotation()

def vex.Inertial.reset_rotation (   self)

Reset the rotation angle of the sensor to 0.

◆ set_heading()

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

brief Set the inertial sensor heading to a new value

Parameters
valueThe new heading for the inertial sensor
rotationUnitsThe rotation unit for the angle

◆ set_rotation()

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

◆ angle()

def vex.Inertial.angle (   self,
  rotationUnits = RotationUnits.DEG 
)

Gets the angle (yaw angle) of the inertial sensor.

Returns
value (float number) specified by the unit.
Parameters
rotationUnitsThe measurement unit for the inertial device.

◆ roll()

def vex.Inertial.roll (   self,
  rotationUnits = RotationUnits.DEG 
)

Gets the roll angle of the inertial sensor.

Returns
value (float number) specified by the unit.
Parameters
rotationUnitsthe measurement unit for the inertial sensor.

◆ pitch()

def vex.Inertial.pitch (   self,
  rotationUnits = RotationUnits.DEG 
)

Gets the pitch angle of the inertial sensor.

Returns
value (float number) specified by the unit.
Parameters
rotationUnitsThe measurement unit for the inertial device.

◆ yaw()

def vex.Inertial.yaw (   self,
  rotationUnits = RotationUnits.DEG 
)

Gets the yaw angle of the inertial sensor.

Returns
value (float number) specified by the unit.
Parameters
rotationUnitsThe measurement unit for the inertial sensor.

◆ orientation()

def vex.Inertial.orientation (   self,
  orientationType,
  rotationUnits = RotationUnits.DEG 
)

Gets an orientation angle of the inertial sensor.

Returns
value (float number) specified by the unit.
Parameters
orientationTypeThe orientation axis to recover, roll, pitch or yaw.
rotationUnitsThe measurement unit for the inertial sensor.

◆ heading()

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

Gets the heading (yaw angle as 0-360 deg) of the inertial sensor.

Returns
value (float number) specified by the unit.
Parameters
rotationUnitsThe measurement unit for the inertial sensor.

◆ rotation()

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

Gets the absolute angle (yaw angle without limits) of the inertial sensor.

Returns
value (float number) specified by the unit.
Parameters
rotationUnitsThe measurement unit for the inertial sensor.

◆ gyro_rate()

def vex.Inertial.gyro_rate (   self,
  axisType,
  velocityUnits = VelocityUnits.RPM 
)

Gets the inertial sensor raw gyro data in specified units.

Parameters
axisTypethe inertial sensor axis to use
velocityUnitsThe units return value
Returns
value of the specified inertial sensor axis

◆ acceleration()

def vex.Inertial.acceleration (   self,
  axisType 
)

Gets the inertial sensor raw acceleration data in G.

Parameters
axisTypethe inertial sensor axis to use
Returns
value of the specified inertial sensor axis

◆ type()

def vex.Device.type (   self)
inherited

Get the device type.

Returns
V5DeviceType enum value

◆ installed()

def vex.Device.installed (   self)
inherited

Gets the status of what is installed.

Returns
Returns a true Boolean if the triport is installed. Returns a false Boolean if the triport is not installed.

◆ value()

def vex.Device.value (   self)
inherited