ADIS16470_IMU¶
-
class
adis16470.
ADIS16470_IMU
(*args, **kwargs)¶ Bases:
wpilib.GyroBase
Overloaded function.
- __init__(self: adis16470._adis16470.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.
- __init__(self: adis16470._adis16470.ADIS16470_IMU, yaw_axis: adis16470._adis16470.ADIS16470_IMU.IMUAxis, port: wpilib._wpilib.SPI.Port, cal_time: adis16470._adis16470.ADIS16470CalibrationTime) -> 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
IMUAxis
(arg0: int) → None¶ Bases:
pybind11_builtins.pybind11_object
Members:
kX
kY
kZ
-
kX
= IMUAxis.kX¶
-
kY
= IMUAxis.kY¶
-
kZ
= IMUAxis.kZ¶
-
name
¶ (self: handle) -> str
-
-
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: adis16470._adis16470.ADIS16470CalibrationTime) → 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¶
-
getAccelInstantX
() → float¶
-
getAccelInstantY
() → float¶
-
getAccelInstantZ
() → float¶
-
getAngle
() → float¶ Returns the current integrated angle for the axis specified.
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 based 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.
-
getGyroInstantX
() → float¶
-
getGyroInstantY
() → float¶
-
getGyroInstantZ
() → float¶
-
getRate
() → float¶
-
getXComplementaryAngle
() → float¶
-
getXFilteredAccelAngle
() → float¶
-
getYComplementaryAngle
() → float¶
-
getYFilteredAccelAngle
() → float¶
-
getYawAxis
() → adis16470._adis16470.ADIS16470_IMU.IMUAxis¶
-
initSendable
(builder: wpilib._wpilib.SendableBuilder) → None¶
-
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: adis16470._adis16470.ADIS16470_IMU.IMUAxis) → int¶