drxgfh
This commit is contained in:
@ -17,6 +17,7 @@ import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import frc.robot.Constants;
|
||||
import frc.robot.commands.bras.Bougerbras;
|
||||
|
||||
public class BasePilotable extends SubsystemBase {
|
||||
final CANSparkMax avantdroit = new CANSparkMax(Constants.avantdroit, MotorType.kBrushless);
|
||||
@ -42,6 +43,9 @@ public class BasePilotable extends SubsystemBase {
|
||||
public void drive(double xSpeed, double zRotation){
|
||||
drive.arcadeDrive(xSpeed, zRotation);
|
||||
}
|
||||
public void drive(double xSpeed, double zRotation, boolean square){
|
||||
drive.arcadeDrive(xSpeed, zRotation, square);
|
||||
}
|
||||
public double distance(){
|
||||
return (-avantdroit.getEncoder().getPosition()
|
||||
+avantgauche.getEncoder().getPosition()
|
||||
|
@ -41,12 +41,13 @@ public class Limelight extends SubsystemBase {
|
||||
public void tape() {
|
||||
limelight.setLED(VisionLEDMode.kOn);
|
||||
limelight.setPipelineIndex(1);
|
||||
|
||||
}
|
||||
|
||||
public double getYaw() {
|
||||
var result = limelight.getLatestResult();
|
||||
if(result.hasTargets()){
|
||||
return -result.getBestTarget().getYaw()/30;
|
||||
return -result.getBestTarget().getYaw()/45;
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
Reference in New Issue
Block a user