class wpilib.ADIS16470_IMU(*args, **kwargs)

Bases: _pyntcore._ntcore.NTSendable

Overloaded function.

  1. __init__(self: wpilib._wpilib.ADIS16470_IMU) -> None

Default constructor. Uses CS0 on the 10-pin SPI port, the yaw axis is set to the IMU Z axis, and calibration time is defaulted to 4 seconds.

  1. __init__(self: wpilib._wpilib.ADIS16470_IMU, yaw_axis: wpilib._wpilib.ADIS16470_IMU.IMUAxis, port: wpilib._wpilib.SPI.Port, cal_time: wpilib._wpilib.ADIS16470_IMU.CalibrationTime) -> None

Customizable constructor. Allows the SPI port and CS to be customized, the yaw axis used for GetAngle() is adjustable, and initial calibration time can be modified.

  • yaw_axis – Selects the “default” axis to use for GetAngle() and GetRate()

  • port – The SPI port and CS where the IMU is connected.

  • cal_time – The calibration time that should be used on start-up.

class CalibrationTime(value: int)

Bases: pybind11_builtins.pybind11_object














property name
property value
class IMUAxis(value: int)

Bases: pybind11_builtins.pybind11_object





kX = <IMUAxis.kX: 0>
kY = <IMUAxis.kY: 1>
kZ = <IMUAxis.kZ: 2>
property name
property value
calibrate() None

Switches the active SPI port to standard SPI mode, writes the command to activate the new null configuration, and re-enables auto SPI.

configCalTime(new_cal_time: wpilib._wpilib.ADIS16470_IMU.CalibrationTime) int

Switches the active SPI port to standard SPI mode, writes a new value to the NULL_CNFG register in the IMU, and re-enables auto SPI.

configDecRate(reg: int) int
getAccelX() meters_per_second_squared

Returns the acceleration in the X axis.

getAccelY() meters_per_second_squared

Returns the acceleration in the Y axis.

getAccelZ() meters_per_second_squared

Returns the acceleration in the Z axis.

getAngle() degrees

Returns the yaw axis angle in degrees (CCW positive).

getPort() int

Get the SPI port number.


The SPI port number.

getRate() degrees_per_second

Returns the yaw axis angular rate in degrees per second (CCW positive).

getXComplementaryAngle() degrees
getXFilteredAccelAngle() degrees
getYComplementaryAngle() degrees
getYFilteredAccelAngle() degrees
getYawAxis() wpilib._wpilib.ADIS16470_IMU.IMUAxis
initSendable(builder: _pyntcore._ntcore.NTSendableBuilder) None
property m_yaw_axis
reset() None

Resets (zeros) the xgyro, ygyro, and zgyro angle integrations.

Resets the gyro accumulations to a heading of zero. This can be used if the “zero” orientation of the sensor needs to be changed in runtime.

setYawAxis(yaw_axis: wpilib._wpilib.ADIS16470_IMU.IMUAxis) int