Help with command to get turnrate
We are working on swerve code for our new chassis this year, and ran into an issue where the original command in the 2023 rev max swerve template did not work with our pigeon2
The original command was .getrate, and we messed around with some other commands to see if any work, and we couldn’t find any.
This is our current code for the command
anyone know of math or a command that we can use to get the turn rate?
public double getTurnRate() {
return m_gyro.getRawGyro(m_gyro.getRoll(), m_gyro.getPitch(), m_gyro.getYaw()) * (DriveConstants.kGyroReversed ? -1.0 : 1.0);
//this is something close, xyz to roll pitch and yaw, see link below
//.getrate replaced with .getrawgyro (https://www.chiefdelphi.com/t/does-pigeon-imu-have-an-equivalent-to-navx-getrate/375640)
}
}