ADIS16470_IMU

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

Bases: 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.

Parameters:
  • 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_object

Members:

_32ms

_64ms

_128ms

_256ms

_512ms

_1s

_2s

_4s

_8s

_16s

_32s

_64s

property name
property value
class IMUAxis(value: int)

Bases: pybind11_object

Members:

kX

kY

kZ

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.

Returns:

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: ntcore._ntcore.NTSendableBuilder) None
isConnected() bool
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