This commit is contained in:
Olivier Dubois 2023-02-13 19:31:25 -05:00
commit eedeedf332
9 changed files with 16 additions and 27 deletions

Binary file not shown.

View File

@ -20,29 +20,7 @@ public class Constants {
public static int limitbg = 2; public static int limitbg = 2;
public static int limithd = 3; public static int limithd = 3;
public static int limithg = 1; public static int limithg = 1;
public static int BrasTelescopique = 5; public static int BrasTelescopique = 5;
<<<<<<< HEAD
public static int actuateur = 4;
public static int actuateur = 4;
// pneumatique
public static int pistonpinceouvre = 0;
public static int pistonpinceferme = 1;
public static int BrasTelescopique = 5;
public static int actuateur = 4;
=======
>>>>>>> 0c37463a91f99a8623a1405743145ad70a140362
} }

View File

@ -33,7 +33,7 @@ public class Gyro extends CommandBase {
} }
else else
{ {
basvjePilotable.drive(0, 0, 0); basePilotable.drive(0, 0, 0);
} }
} }

View File

@ -10,6 +10,7 @@ import com.revrobotics.CANSparkMaxLowLevel.MotorType;
import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import edu.wpi.first.wpilibj.drive.DifferentialDrive; import edu.wpi.first.wpilibj.drive.DifferentialDrive;
import edu.wpi.first.wpilibj.motorcontrol.MotorControllerGroup; import edu.wpi.first.wpilibj.motorcontrol.MotorControllerGroup;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
@ -23,9 +24,12 @@ public class BasePilotable extends SubsystemBase {
final MotorControllerGroup droit = new MotorControllerGroup(avantdroit, arrieredroit); final MotorControllerGroup droit = new MotorControllerGroup(avantdroit, arrieredroit);
final MotorControllerGroup gauche = new MotorControllerGroup(avantgauche, arrieregauche); final MotorControllerGroup gauche = new MotorControllerGroup(avantgauche, arrieregauche);
final DifferentialDrive drive = new DifferentialDrive(gauche, droit); final DifferentialDrive drive = new DifferentialDrive(gauche, droit);
//piston
private DoubleSolenoid brakedroit = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakedroit, Constants.brakedroit);
private DoubleSolenoid brakegauche = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakegauche, Constants.brakegauche);
//gyro
private AHRS gyroscope = new AHRS();public double getangle() {return gyroscope.getAngle();} private AHRS gyroscope = new AHRS();public double getangle() {return gyroscope.getAngle();}
public double getpitch() {
public double getpitch() {
return gyroscope.getPitch(); return gyroscope.getPitch();
} }
@ -44,7 +48,14 @@ public class BasePilotable extends SubsystemBase {
arrieredroit.getEncoder().setPosition(0); arrieredroit.getEncoder().setPosition(0);
arrieregauche.getEncoder().setPosition(0); arrieregauche.getEncoder().setPosition(0);
} }
public void BrakeOuvre(){
brakedroit.set(Value.kForward);
brakegauche.set(Value.kForward);
}
public void BrakeFerme(){
brakedroit.set(Value.kReverse);
brakegauche.set(Value.kReverse);
}
/** Creates a new BasePilotable. */ /** Creates a new BasePilotable. */
public BasePilotable() { public BasePilotable() {
droit.setInverted(true); droit.setInverted(true);