WPI_PigeonIMU
- class phoenix5.sensors.WPI_PigeonIMU(*args, **kwargs)
Bases:
PigeonIMU
,Sendable
Overloaded function.
__init__(self: phoenix5._ctre.sensors.WPI_PigeonIMU, deviceNumber: int) -> None
Construtor for WPI_PigeonIMU.
- Parameters:
deviceNumber – CAN Device ID of the Pigeon IMU.
__init__(self: phoenix5._ctre.sensors.WPI_PigeonIMU, talon: phoenix5._ctre.TalonSRX) -> None
Construtor for WPI_PigeonIMU.
- Parameters:
talon – The Talon SRX ribbon-cabled to Pigeon.
- getAngle() float
Returns the heading of the robot in degrees.
The angle increases as the Pigeon IMU turns clockwise when looked at from the top. This follows the NED axis convention.
details The angle is continuous; that is, it will continue from 360 to 361 degrees. This allows for algorithms that wouldn’t want to see a discontinuity in the gyro output as it sweeps past from 360 to 0 on the second time around.
- Returns:
The current heading of the robot in degrees
- getRate() float
Returns the rate of rotation of the Pigeon IMU.
The rate is positive as the Pigeon IMU turns clockwise when looked at from the top.
- Returns:
The current rate in degrees per second
- getRotation2d() wpimath.geometry._geometry.Rotation2d
Returns the heading of the robot as a frc#Rotation2d.
The angle increases as the Pigeon IMU turns counterclockwise when looked at from the top. This follows the NWU axis convention.
details The angle is continuous; that is, it will continue from 360 to 361 degrees. This allows for algorithms that wouldn’t want to see a discontinuity in the gyro output as it sweeps past from 360 to 0 on the second time around.
- Returns:
The current heading of the robot as a frc#Rotation2d
- initSendable(builder: wpiutil._wpiutil.SendableBuilder) None
- reset() None
Resets the Pigeon IMU to a heading of zero.
details This can be used if there is significant drift in the gyro, and it needs to be recalibrated after it has been running.