bhbhbhbhh hbhbhbgfe

This commit is contained in:
Olivier Dubois 2023-03-07 18:53:40 -05:00
parent 42ffd20962
commit 8655fe985a
8 changed files with 19 additions and 82 deletions

View File

@ -5,18 +5,12 @@ public class Constants {
public static int avantgauche = 1; public static int avantgauche = 1;
public static int arrieredroit = 2; public static int arrieredroit = 2;
public static int arrieregauche = 3; public static int arrieregauche = 3;
<<<<<<< HEAD
public static int BrasTelescopique = 4; public static int BrasTelescopique = 4;
public static int pivot = 5; public static int pivot = 5;
//moteur //moteur
public static int leverGratte = 0; public static int leverGratte = 0;
public static int baisserGratte = 1; public static int baiserGratte = 1;
=======
public static int leverGratte = 7;
public static int baisserGratte = 6;
>>>>>>> Dash
// pneumatique // pneumatique
public static int pistonpinceouvre = 0; public static int pistonpinceouvre = 0;

View File

@ -6,7 +6,6 @@ package frc.robot;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.Commands;
<<<<<<< HEAD
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.RunCommand; import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
@ -17,7 +16,6 @@ import frc.robot.subsystems.Gratte;
import frc.robot.subsystems.bras.BrasTelescopique; import frc.robot.subsystems.bras.BrasTelescopique;
import frc.robot.subsystems.bras.Pince; import frc.robot.subsystems.bras.Pince;
import frc.robot.subsystems.bras.Pivot; import frc.robot.subsystems.bras.Pivot;
import pabeles.concurrency.ConcurrencyOps.Reset;
import frc.robot.subsystems.Limelight; import frc.robot.subsystems.Limelight;
// command // command
import frc.robot.commands.BrakeFerme; import frc.robot.commands.BrakeFerme;
@ -33,12 +31,7 @@ import frc.robot.commands.bras.PivotBrasRentre;
import frc.robot.commands.bras.PivoteBrasBas; import frc.robot.commands.bras.PivoteBrasBas;
import frc.robot.commands.bras.PivoteBrasHaut; import frc.robot.commands.bras.PivoteBrasHaut;
import frc.robot.commands.bras.PivoteBrasMilieux; import frc.robot.commands.bras.PivoteBrasMilieux;
import frc.robot.commands.bras.PivotChercheBas;
import frc.robot.commands.bras.PivotChercheHaut;
import edu.wpi.first.apriltag.AprilTag;
import frc.robot.commands.Cube;
import frc.robot.commands.Cone;
import frc.robot.commands.Tape;
public class RobotContainer { public class RobotContainer {
CommandXboxController manette1 = new CommandXboxController(0); CommandXboxController manette1 = new CommandXboxController(0);
@ -64,23 +57,6 @@ PivoteBrasMilieux pivoteBrasMilieux = new PivoteBrasMilieux(brasTelescopique, pi
PivoteBrasHaut pivoteBrasHaut = new PivoteBrasHaut(brasTelescopique, pivot); PivoteBrasHaut pivoteBrasHaut = new PivoteBrasHaut(brasTelescopique, pivot);
Cone cone = new Cone(limelight, basePilotable, ()->-manette1.getLeftY()); Cone cone = new Cone(limelight, basePilotable, ()->-manette1.getLeftY());
public RobotContainer() { public RobotContainer() {
=======
import frc.robot.subsystems.BasePilotable;
import frc.robot.subsystems.Gratte;
import frc.robot.subsystems.Limelight;
import frc.robot.subsystems.bras.BrasTelescopique;
import frc.robot.subsystems.bras.Pince;
import frc.robot.subsystems.bras.Pivot;
public class RobotContainer {
BasePilotable basePilotable = new BasePilotable();
Gratte gratte = new Gratte();
BrasTelescopique brasTelescopique = new BrasTelescopique();
Pince pince = new Pince();
Pivot pivot = new Pivot();
Limelight limelight = new Limelight();
public RobotContainer() {
>>>>>>> Dash
configureBindings(); configureBindings();
basePilotable.setDefaultCommand(new RunCommand(() -> { basePilotable.setDefaultCommand(new RunCommand(() -> {
@ -89,24 +65,21 @@ public class RobotContainer {
} }
private boolean configureBindings() { private void configureBindings() {
// manette 1
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.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));
// manette 2 manette2.a().toggleOnTrue(Commands.startEnd(brasTelescopique::pivoteBrasHaut, brasTelescopique::pivoteBrasHaut));
manette2.a().toggleOnTrue(Commands.startEnd(brasTelescopique::pivoteBrasHaut, brasTelescopique::pivoteBrasHaut, brasTelescopique));
manette2.b().toggleOnTrue(Commands.startEnd(brasTelescopique::pivoteBrasBas, brasTelescopique::pivoteBrasBas, brasTelescopique)); manette2.b().toggleOnTrue(Commands.startEnd(brasTelescopique::pivoteBrasBas, brasTelescopique::pivoteBrasBas, brasTelescopique));
manette2.x().toggleOnTrue(Commands.startEnd(brasTelescopique::pivoteBrasMilieux, brasTelescopique::pivoteBrasMilieux, brasTelescopique)); manette2.x().toggleOnTrue(Commands.startEnd(brasTelescopique::pivoteBrasMilieux, brasTelescopique::pivoteBrasMilieux, brasTelescopique));
manette2.y().toggleOnTrue(Commands.startEnd(brasTelescopique::pivotBrasRentre, brasTelescopique::pivotBrasRentre, brasTelescopique)); manette2.y().toggleOnTrue(Commands.startEnd(brasTelescopique::pivotBrasRentre, brasTelescopique::pivotBrasRentre, brasTelescopique));
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));
manette2.leftBumper().toggleOnTrue(Commands.startEnd(null, null, null)); manette2.leftBumper().toggleOnTrue(Commands.startEnd(null, null, null));**/
} }
public Command getAutonomousCommand() { public Command getAutonomousCommand() {

View File

@ -35,7 +35,7 @@ public class BasePilotable extends SubsystemBase {
//gyro //gyro
ShuffleboardTab teb = Shuffleboard.getTab("teb"); ShuffleboardTab teb = Shuffleboard.getTab("teb");
ShuffleboardLayout layout = Shuffleboard.getTab("teb") ShuffleboardLayout layout = Shuffleboard.getTab("teb")
.getLayout ("encodeurs base pilotable", BuiltInLayouts.kList) .getLayout ("distance", BuiltInLayouts.kList)
.withSize(2, 2); .withSize(2, 2);
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() {
@ -72,12 +72,11 @@ public void resetGyro(){
/** Creates a new BasePilotable. */ /** Creates a new BasePilotable. */
public BasePilotable() { public BasePilotable() {
droit.setInverted(true); droit.setInverted(true);
layout .addDouble("distance", this::distance);
} }
@Override @Override
public void periodic() { public void periodic() {
teb .add("distance",0.1);
teb .add("brakedroit",0.1);
teb .add("brakegauche", 0.1);
} }
} }

View File

@ -7,27 +7,19 @@ package frc.robot.subsystems;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.DigitalInput;
<<<<<<< HEAD
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
=======
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
>>>>>>> Dash
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; 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");
ShuffleboardLayout limitswitchgratte = Shuffleboard.getTab("teb") ShuffleboardLayout limitswitchgratte = Shuffleboard.getTab("teb")
.getLayout("limitswitchsgratte", BuiltInLayouts.kList) .getLayout("limitswitchsgratte", BuiltInLayouts.kList)
.withSize(2, 2); .withSize(2, 2);
>>>>>>> Dash
private WPI_TalonSRX Gratted = new WPI_TalonSRX(Constants.leverGratte); private WPI_TalonSRX Gratted = new WPI_TalonSRX(Constants.leverGratte);
private WPI_TalonSRX Gratteg = new WPI_TalonSRX(Constants.baisserGratte); private WPI_TalonSRX Gratteg = new WPI_TalonSRX(Constants.baiserGratte);
private DigitalInput limithd = new DigitalInput(Constants.limithd); private DigitalInput limithd = new DigitalInput(Constants.limithd);
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);
@ -59,16 +51,13 @@ ShuffleboardLayout limitswitchgratte = Shuffleboard.getTab("teb")
} }
@Override @Override
public void periodic() { public void periodic() {
<<<<<<< HEAD
teb .add("limithd", 0.1); teb .add("limithd", 0.1);
teb .add("limithg", 0.1); teb .add("limithg", 0.1);
teb .add("limitbd", 0.1); teb .add("limitbd", 0.1);
teb .add("limitbg", 0.1); teb .add("limitbg", 0.1);
=======
limitswitchgratte.add ("limitbd", 0.1); limitswitchgratte.add ("limitbd", 0.1);
limitswitchgratte.add ("limithg", 0.1); limitswitchgratte.add ("limithg", 0.1);
limitswitchgratte.add ("limithd", 0.1); limitswitchgratte.add ("limithd", 0.1);
limitswitchgratte.add ("limitbg", 0.1); limitswitchgratte.add ("limitbg", 0.1);
>>>>>>> Dash
} }
} }

View File

@ -8,13 +8,10 @@ package frc.robot.subsystems.bras;
import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType; import com.revrobotics.CANSparkMaxLowLevel.MotorType;
<<<<<<< HEAD
import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.DigitalInput;
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.DoubleSolenoid.Value;
=======
>>>>>>> Dash
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
@ -23,18 +20,13 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants; import frc.robot.Constants;
public class BrasTelescopique extends SubsystemBase { public class BrasTelescopique extends SubsystemBase {
<<<<<<< HEAD
ShuffleboardTab teb = Shuffleboard.getTab("teb"); ShuffleboardTab teb = Shuffleboard.getTab("teb");
ShuffleboardLayout layout = Shuffleboard.getTab("teb") ShuffleboardLayout layout = Shuffleboard.getTab("teb")
.getLayout("layout", BuiltInLayouts.kList) .getLayout("layout", BuiltInLayouts.kList)
.withSize(2, 2); .withSize(2, 2);
======= ShuffleboardLayout bras = Shuffleboard.getTab("teb")
.getLayout("bras", BuiltInLayouts.kList)
ShuffleboardTab teb = Shuffleboard.getTab("teb"); .withSize(2, 2);
ShuffleboardLayout bras = Shuffleboard.getTab("teb")
.getLayout("bras", BuiltInLayouts.kList)
.withSize(2, 2);
>>>>>>> Dash
/** 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);
@ -60,11 +52,8 @@ ShuffleboardLayout bras = Shuffleboard.getTab("teb")
} }
@Override @Override
public void periodic() { public void periodic() {
<<<<<<< HEAD
teb .add("photocell",0.1); teb .add("photocell",0.1);
teb .add("winch",0.1); teb .add("winch",0.1);
=======
bras.add ("encodeur",0.1); bras.add ("encodeur",0.1);
>>>>>>> Dash
} }
} }

View File

@ -8,8 +8,7 @@ import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import frc.robot.Constants; import frc.robot.Constants;

View File

@ -14,11 +14,7 @@ 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");
>>>>>>> Dash
// 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);
@ -40,12 +36,10 @@ ShuffleboardTab teb = Shuffleboard.getTab("teb");
} }
@Override @Override
public void periodic() { public void periodic() {
<<<<<<< HEAD
teb .add("encodeur", 0.1); teb .add("encodeur", 0.1);
}
}
=======
teb .add ("encodeur pivot",0.1); teb .add ("encodeur pivot",0.1);
} }
} }
>>>>>>> Dash