This commit is contained in:
Olivier Dubois 2023-03-07 18:54:18 -05:00
commit 27d5b3cad7
8 changed files with 41 additions and 5 deletions

View File

@ -10,7 +10,11 @@ public class Constants {
//moteur //moteur
public static int leverGratte = 0; public static int leverGratte = 0;
<<<<<<< HEAD
public static int baiserGratte = 1; public static int baiserGratte = 1;
=======
public static int baisserGratte = 1;
>>>>>>> cd7604e30f9d6c974930cf5af86554639315c8a0
// pneumatique // pneumatique
public static int pistonpinceouvre = 0; public static int pistonpinceouvre = 0;

View File

@ -69,7 +69,6 @@ public RobotContainer() {
manette1.a().toggleOnTrue(Commands.startEnd(pince::ouvrir, pince::fermer,pince)); manette1.a().toggleOnTrue(Commands.startEnd(pince::ouvrir, pince::fermer,pince));
manette1.x().toggleOnTrue(Commands.startEnd(basePilotable::BrakeFerme,basePilotable::BrakeOuvre,basePilotable)); manette1.x().toggleOnTrue(Commands.startEnd(basePilotable::BrakeFerme,basePilotable::BrakeOuvre,basePilotable));
manette1.y().whileTrue(gyro); manette1.y().whileTrue(gyro);
// manette1.b().toggleOnTrue(Commands.startEnd(gratte::baiser, gratte::Lever,gratte));
manette1.start().toggleOnTrue(Commands.startEnd(basePilotable::resetGyro, basePilotable::resetGyro, basePilotable)); manette1.start().toggleOnTrue(Commands.startEnd(basePilotable::resetGyro, basePilotable::resetGyro, basePilotable));
/*manette1.b().toggleOnTrue(Commands.startEnd(gratte::baiser, gratte::Lever,gratte)); /*manette1.b().toggleOnTrue(Commands.startEnd(gratte::baiser, gratte::Lever,gratte));
manette2.a().toggleOnTrue(Commands.startEnd(brasTelescopique::pivoteBrasHaut, brasTelescopique::pivoteBrasHaut)); manette2.a().toggleOnTrue(Commands.startEnd(brasTelescopique::pivoteBrasHaut, brasTelescopique::pivoteBrasHaut));
@ -79,7 +78,12 @@ public RobotContainer() {
manette2.povRight().toggleOnTrue(Commands.startEnd(brasTelescopique::PivotChercheBas, brasTelescopique::PivotChercheBas, brasTelescopique)); manette2.povRight().toggleOnTrue(Commands.startEnd(brasTelescopique::PivotChercheBas, brasTelescopique::PivotChercheBas, brasTelescopique));
manette2.povLeft().toggleOnTrue(Commands.startEnd(brasTelescopique::PivotChercheHaut, brasTelescopique::PivotChercheHaut, brasTelescopique)); manette2.povLeft().toggleOnTrue(Commands.startEnd(brasTelescopique::PivotChercheHaut, brasTelescopique::PivotChercheHaut, brasTelescopique));
manette2.rightBumper().toggleOnTrue(Commands.startEnd(null, null, null)); manette2.rightBumper().toggleOnTrue(Commands.startEnd(null, null, null));
<<<<<<< HEAD
manette2.leftBumper().toggleOnTrue(Commands.startEnd(null, null, null));**/ manette2.leftBumper().toggleOnTrue(Commands.startEnd(null, null, null));**/
=======
manette2.leftBumper().toggleOnTrue(Commands.startEnd(null, null, null));
>>>>>>> cd7604e30f9d6c974930cf5af86554639315c8a0
} }
public Command getAutonomousCommand() { public Command getAutonomousCommand() {

View File

@ -41,7 +41,9 @@ public class GratteBaisser extends CommandBase {
// Called once the command ends or is interrupted. // Called once the command ends or is interrupted.
@Override @Override
public void end(boolean interrupted) {} public void end(boolean interrupted) {
}
// Returns true when the command should end. // Returns true when the command should end.
@Override @Override

View File

@ -66,9 +66,8 @@ public void BrakeFerme(){
brakegauche.set(Value.kReverse); brakegauche.set(Value.kReverse);
} }
public void resetGyro(){ public void resetGyro(){
try {gyroscope.reset();} catch(Exception e){DriverStation.reportError("bye bye",true); {gyroscope.reset();}
} }
}
/** Creates a new BasePilotable. */ /** Creates a new BasePilotable. */
public BasePilotable() { public BasePilotable() {
droit.setInverted(true); droit.setInverted(true);

View File

@ -14,7 +14,11 @@ import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import frc.robot.Constants; import frc.robot.Constants;
public class Gratte extends SubsystemBase { public class Gratte extends SubsystemBase {
<<<<<<< HEAD
ShuffleboardTab teb = Shuffleboard.getTab("teb"); ShuffleboardTab teb = Shuffleboard.getTab("teb");
=======
ShuffleboardTab teb = Shuffleboard.getTab("teb");
>>>>>>> cd7604e30f9d6c974930cf5af86554639315c8a0
ShuffleboardLayout limitswitchgratte = Shuffleboard.getTab("teb") ShuffleboardLayout limitswitchgratte = Shuffleboard.getTab("teb")
.getLayout("limitswitchsgratte", BuiltInLayouts.kList) .getLayout("limitswitchsgratte", BuiltInLayouts.kList)
.withSize(2, 2); .withSize(2, 2);
@ -24,6 +28,7 @@ ShuffleboardLayout limitswitchgratte = Shuffleboard.getTab("teb")
private DigitalInput limithg = new DigitalInput(Constants.limithg); private DigitalInput limithg = new DigitalInput(Constants.limithg);
private DigitalInput limitbd = new DigitalInput(Constants.limitbd); private DigitalInput limitbd = new DigitalInput(Constants.limitbd);
private DigitalInput limitbg = new DigitalInput(Constants.limitbg); private DigitalInput limitbg = new DigitalInput(Constants.limitbg);
public boolean baiser;
public boolean hautd(){ public boolean hautd(){
return limithd.get(); return limithd.get();
@ -33,7 +38,7 @@ ShuffleboardLayout limitswitchgratte = Shuffleboard.getTab("teb")
return limithg.get(); return limithg.get();
} }
public boolean basd(){ public boolean basd(int i, String string){
return limitbd.get(); return limitbd.get();
} }
public boolean basg(){ public boolean basg(){
@ -60,4 +65,8 @@ ShuffleboardLayout limitswitchgratte = Shuffleboard.getTab("teb")
limitswitchgratte.add ("limithd", 0.1); limitswitchgratte.add ("limithd", 0.1);
limitswitchgratte.add ("limitbg", 0.1); limitswitchgratte.add ("limitbg", 0.1);
} }
public boolean basd() {
return false;
}
} }

View File

@ -24,9 +24,16 @@ public class BrasTelescopique extends SubsystemBase {
ShuffleboardLayout layout = Shuffleboard.getTab("teb") ShuffleboardLayout layout = Shuffleboard.getTab("teb")
.getLayout("layout", BuiltInLayouts.kList) .getLayout("layout", BuiltInLayouts.kList)
.withSize(2, 2); .withSize(2, 2);
<<<<<<< HEAD
ShuffleboardLayout bras = Shuffleboard.getTab("teb") ShuffleboardLayout bras = Shuffleboard.getTab("teb")
.getLayout("bras", BuiltInLayouts.kList) .getLayout("bras", BuiltInLayouts.kList)
.withSize(2, 2); .withSize(2, 2);
=======
ShuffleboardLayout bras = Shuffleboard.getTab("teb")
.getLayout("bras", BuiltInLayouts.kList)
.withSize(2, 2);
>>>>>>> cd7604e30f9d6c974930cf5af86554639315c8a0
/** Creates a new BrasTelescopique. */ /** Creates a new BrasTelescopique. */
public BrasTelescopique() {} public BrasTelescopique() {}
final CANSparkMax Winch = new CANSparkMax(Constants.BrasTelescopique,MotorType.kBrushless); final CANSparkMax Winch = new CANSparkMax(Constants.BrasTelescopique,MotorType.kBrushless);

View File

@ -14,7 +14,11 @@ import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType; import com.revrobotics.CANSparkMaxLowLevel.MotorType;
public class Pivot extends SubsystemBase { public class Pivot extends SubsystemBase {
<<<<<<< HEAD
ShuffleboardTab teb = Shuffleboard.getTab("teb"); ShuffleboardTab teb = Shuffleboard.getTab("teb");
=======
ShuffleboardTab teb = Shuffleboard.getTab("teb");
>>>>>>> cd7604e30f9d6c974930cf5af86554639315c8a0
// moteur // moteur
private CANSparkMax pivot = new CANSparkMax(Constants.pivot,MotorType.kBrushless); private CANSparkMax pivot = new CANSparkMax(Constants.pivot,MotorType.kBrushless);
private DigitalInput limitpivot = new DigitalInput(Constants.limitpivot); private DigitalInput limitpivot = new DigitalInput(Constants.limitpivot);
@ -39,7 +43,14 @@ ShuffleboardTab teb = Shuffleboard.getTab("teb");
teb .add("encodeur", 0.1); teb .add("encodeur", 0.1);
teb .add ("encodeur pivot",0.1); teb .add ("encodeur pivot",0.1);
} }
<<<<<<< HEAD
} }
=======
{
teb.add ("encodeur pivot",0.1);
}
}
>>>>>>> cd7604e30f9d6c974930cf5af86554639315c8a0