Pigeon 2.0 heading being delay by 2-3 seconds

Our robots pigeon is giving delay information about the heading of the robot while we are driving. This has resulted in our robot not driving properly in field oriented mode. The robots direction will slowly become further from direction it should be. Any thoughts?

Our Field Oriented Code:
if (fieldOrientedFunction.get()) {
chassisSpeeds = ChassisSpeeds.fromFieldRelativeSpeeds(
xSpeed, ySpeed, turningSpeed, new Rotation2d(drivetrain.getRotation2d().getRadians()));
} else {
// Relative to robot
chassisSpeeds = new ChassisSpeeds(xSpeed, ySpeed, turningSpeed);
}

Ty for any and all help :slight_smile:

Did you ever find the answer to your problem?

Also, you can just use drivetrain.getRotation2d() instead of new Rotation2d(drivetrain.getRotation2d().getRadians()).

Yes, we forgot to configure our pigeon

1 Like