Gyroscope
This commit is contained in:
		| @@ -4,6 +4,7 @@ | ||||
|  | ||||
| package frc.robot.subsystems; | ||||
|  | ||||
| import com.kauailabs.navx.frc.AHRS; | ||||
| import com.revrobotics.CANSparkMax; | ||||
| import com.revrobotics.CANSparkMaxLowLevel.MotorType; | ||||
|  | ||||
| @@ -25,8 +26,13 @@ public class BasePilotable extends SubsystemBase { | ||||
|   final MotorControllerGroup gauche = new MotorControllerGroup(avantgauche, arrieregauche); | ||||
|  | ||||
|   final DifferentialDrive drive = new DifferentialDrive(gauche, droit); | ||||
|   private AHRS gyroscope = new AHRS();public double getangle() {return gyroscope.getAngle();} | ||||
|  | ||||
|   public void drive(double xSpeed, double zRotation){ | ||||
|   public double getpitch() { | ||||
|     return gyroscope.getPitch(); | ||||
|   } | ||||
|  | ||||
|   public void drive(double xSpeed, double zRotation, int i){ | ||||
|     drive.arcadeDrive(xSpeed, zRotation); | ||||
|   } | ||||
|   public double distance(){ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user