1
1
package frc .robot .subsystems .drive ;
2
2
3
- import com .kauailabs .vmx .AHRSJNI ;
4
3
import edu .wpi .first .math .kinematics .SwerveDriveOdometry ;
5
4
import edu .wpi .first .wpilibj .smartdashboard .SmartDashboard ;
6
5
import edu .wpi .first .wpilibj2 .command .SubsystemBase ;
7
6
8
7
import frc .Constants .SwerveConstants ;
9
- import com .kauailabs .navx .frc .AHRS ;
10
8
11
9
public class DrivebaseSubsytem extends SubsystemBase {
12
10
/** Creates a new DriveBase. */
@@ -15,10 +13,10 @@ public class DrivebaseSubsytem extends SubsystemBase {
15
13
private final SwerveModule backRight ;
16
14
private final SwerveModule backLeft ;
17
15
public final SwerveDriveOdometry odometry ;
18
- private final AHRS ahrs ;
16
+
19
17
public DrivebaseSubsytem () {
20
18
this .odometry = new SwerveDriveOdometry (null , null , null );
21
- this . ahrs = new AHRS ();
19
+
22
20
frontRight = new SwerveModule (SwerveConstants .frontRightTurnMotorID , SwerveConstants .frontRightDriveMotorID , SwerveConstants .frontRightTurnEncoderID ,SwerveConstants .frontRightEncoderOffset );
23
21
frontLeft = new SwerveModule (SwerveConstants .frontLeftTurnMotorID , SwerveConstants .frontLeftDriveMotorID , SwerveConstants .frontLeftTurnEncoderID , SwerveConstants .frontLeftEncoderOffset );
24
22
backRight = new SwerveModule (SwerveConstants .backRightTurnMotorID , SwerveConstants .backRightDriveMotorID , SwerveConstants .backRightTurnEncoderID , SwerveConstants .backRightEncoderOffset );
@@ -31,18 +29,7 @@ public DrivebaseSubsytem() {
31
29
public void periodic () {
32
30
33
31
}
34
- public double getPitch (){
35
- return ahrs .getPitch ();
36
- }
37
- public void resetYaw (){
38
- ahrs .zeroYaw ();
39
- }
40
- public double getYaw (){
41
- return ahrs .getYaw ();
42
- }
43
- public double getRoll (){
44
- return ahrs .getRoll ();
45
- }
32
+
46
33
public Boolean distanceReached (double distance ){
47
34
return backLeft .reachedDistanced (distance ) && frontRight .reachedDistanced (distance ) && backRight .reachedDistanced (distance ) && frontLeft .reachedDistanced (distance );
48
35
//why is the and && in java :(
0 commit comments