ADIS16448_IMU¶
- class wpilib.ADIS16448_IMU(*args, **kwargs)¶
Bases:
NTSendable
Overloaded function.
__init__(self: wpilib._wpilib.ADIS16448_IMU) -> None
IMU constructor on onboard MXP CS0, Z-up orientation, and complementary AHRS computation.
__init__(self: wpilib._wpilib.ADIS16448_IMU, yaw_axis: wpilib._wpilib.ADIS16448_IMU.IMUAxis, port: wpilib._wpilib.SPI.Port, cal_time: wpilib._wpilib.ADIS16448_IMU.CalibrationTime) -> None
IMU constructor on the specified MXP port and orientation.
- Parameters:
yaw_axis – The axis where gravity is present. Valid options are kX, kY, and kZ
port – The SPI port 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 ¶
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: wpilib._wpilib.ADIS16448_IMU.CalibrationTime) int ¶
Configures the calibration time used for the next calibrate.
- Parameters:
new_cal_time – The calibration time that should be used
- configDecRate(DecimationRate: 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).
- getBarometricPressure() pounds_per_square_inch ¶
- getGyroAngleX() degrees ¶
Returns the accumulated gyro angle in the X axis.
- getGyroAngleY() degrees ¶
Returns the accumulated gyro angle in the Y axis.
- getGyroAngleZ() degrees ¶
Returns the accumulated gyro angle in the Z axis.
- getGyroRateX() degrees_per_second ¶
Returns the angular rate in the X axis.
- getGyroRateY() degrees_per_second ¶
Returns the angular rate in the Y axis.
- getGyroRateZ() degrees_per_second ¶
Returns the angular rate in the Z axis.
- getMagneticFieldX() teslas ¶
- getMagneticFieldY() teslas ¶
- getMagneticFieldZ() teslas ¶
- 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).
- getTemperature() celsius ¶
- getXComplementaryAngle() degrees ¶
- getXFilteredAccelAngle() degrees ¶
- getYComplementaryAngle() degrees ¶
- getYFilteredAccelAngle() degrees ¶
- getYawAxis() wpilib._wpilib.ADIS16448_IMU.IMUAxis ¶
- initSendable(builder: ntcore._ntcore.NTSendableBuilder) None ¶
- isConnected() bool ¶
- 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: wpilib._wpilib.ADIS16448_IMU.IMUAxis) int ¶