This repository was archived by the owner on Dec 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/main/java/swervelib/imu Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,15 @@ public class Pigeon2Swerve extends SwerveIMU
2626 /**
2727 * Offset for the Pigeon 2.
2828 */
29- private Rotation3d offset = new Rotation3d ();
29+ private Rotation3d offset = new Rotation3d ();
3030 /**
3131 * Inversion for the gyro
3232 */
33- private boolean invertedIMU = false ;
33+ private boolean invertedIMU = false ;
34+ /**
35+ * Pigeon2 configurator.
36+ */
37+ private Pigeon2Configurator cfg ;
3438
3539 /**
3640 * Generate the SwerveIMU for pigeon.
@@ -41,6 +45,7 @@ public class Pigeon2Swerve extends SwerveIMU
4145 public Pigeon2Swerve (int canid , String canbus )
4246 {
4347 imu = new Pigeon2 (canid , canbus );
48+ this .cfg = imu .getConfigurator ();
4449 SmartDashboard .putData (imu );
4550 }
4651
@@ -60,7 +65,6 @@ public Pigeon2Swerve(int canid)
6065 @ Override
6166 public void factoryDefault ()
6267 {
63- Pigeon2Configurator cfg = imu .getConfigurator ();
6468 Pigeon2Configuration config = new Pigeon2Configuration ();
6569
6670 // Compass utilization causes readings to jump dramatically in some cases.
You can’t perform that action at this time.
0 commit comments