class adis16448.ADIS16448_IMU(*args, **kwargs)

Bases: wpilib.GyroBase

Overloaded function.

  1. __init__(self: adis16448._adis16448.ADIS16448_IMU) -> None

IMU constructor on onboard MXP CS0, Z-up orientation, and complementary AHRS computation.

  1. __init__(self: adis16448._adis16448.ADIS16448_IMU, yaw_axis: adis16448._adis16448.ADIS16448_IMU.IMUAxis, port: wpilib._wpilib.SPI.Port, cal_time: int) -> None

IMU constructor on the specified MXP port and orientation.

  • yaw_axis – The axis where gravity is present. Valid options are kX, kY, and kZ
  • algorithm – The AHRS algorithm to use. Valid options are kComplementary and kMadgwick
  • port – The SPI port where the IMU is connected.
class IMUAxis(arg0: int) → None

Bases: pybind11_builtins.pybind11_object





kX = IMUAxis.kX
kY = IMUAxis.kY
kZ = IMUAxis.kZ

(self: handle) -> str

calibrate() → None

Initialize the IMU.

Perform gyro offset calibration by collecting data for a number of seconds and computing the center value. The center value is subtracted from subsequent measurements.

It’s important to make sure that the robot is not moving while the centering calculations are in progress, this is typically done when the robot is first turned on while it’s sitting at rest before the match starts.

The calibration routine can be triggered by the user during runtime.

configCalTime(new_cal_time: int) → int
configDecRate(DecimationRate: int) → int
getAccelInstantX() → float
getAccelInstantY() → float
getAccelInstantZ() → float
getAngle() → float

Return the actual angle in degrees that the robot is currently facing.

The angle is based on the current accumulator value corrected by offset calibration and built-in IMU calibration. The angle is continuous, that is it will continue from 360->361 degrees. This allows algorithms that wouldn’t want to see a discontinuity in the gyro output as it sweeps from 360 to 0 on the second time around. The axis returned by this function is adjusted fased on the configured yaw_axis.

Returns:the current heading of the robot in degrees. This heading is based on integration of the returned rate from the gyro.
getBarometricPressure() → float
getGyroAngleX() → float
getGyroAngleY() → float
getGyroAngleZ() → float
getGyroInstantX() → float
getGyroInstantY() → float
getGyroInstantZ() → float
getMagInstantX() → float
getMagInstantY() → float
getMagInstantZ() → float
getRate() → float

Return the rate of rotation of the yaw_axis gyro.

The rate is based on the most recent reading of the gyro value

Returns:the current rate in degrees per second
getTemperature() → float
getXComplementaryAngle() → float
getXFilteredAccelAngle() → float
getYComplementaryAngle() → float
getYFilteredAccelAngle() → float
getYawAxis() → adis16448._adis16448.ADIS16448_IMU.IMUAxis
reset() → None

Reset the gyro.

Resets the gyro accumulations to a heading of zero. This can be used if there is significant drift in the gyro and it needs to be recalibrated after running.

setYawAxis(yaw_axis: adis16448._adis16448.ADIS16448_IMU.IMUAxis) → int