diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 21e30aa..1206c23 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -45,8 +45,7 @@ public class Constants { // Limit switch public static int guideurhaut = 0; public static int guideurbas = 1; - public static int limitacc = 2; - public static int limitacc2 = 3; + public static int photocellacc = 2; public static int limithaut = 4; public static int limitbas = 5; diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 3fb4b54..7b50586 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -54,6 +54,7 @@ public class RobotContainer { Lancerampli lancerampli = new Lancerampli(lanceur); CommandJoystick joystick = new CommandJoystick(0); CommandXboxController manette = new CommandXboxController(1); + //command GrimpeurDroit grimpeurDroit = new GrimpeurDroit(grimpeur, manette::getLeftX); GrimpeurGauche grimpeurGauche = new GrimpeurGauche(grimpeur, manette::getLeftY); public RobotContainer() { diff --git a/src/main/java/frc/robot/subsystem/Accumulateur.java b/src/main/java/frc/robot/subsystem/Accumulateur.java index 82ade1e..2c43a06 100644 --- a/src/main/java/frc/robot/subsystem/Accumulateur.java +++ b/src/main/java/frc/robot/subsystem/Accumulateur.java @@ -24,7 +24,7 @@ public class Accumulateur extends SubsystemBase { .getEntry(); final WPI_TalonSRX Moteuracc2 = new WPI_TalonSRX(Constants.Moteuracc2); final WPI_TalonSRX Moteuracc = new WPI_TalonSRX(Constants.Moteuracc); - final DigitalInput limitacc = new DigitalInput(Constants.limitacc); + final DigitalInput photocellacc = new DigitalInput(Constants.photocellacc); public void Deaccumuler(double vitesse){ Moteuracc2.set(vitesse); @@ -34,7 +34,7 @@ public class Accumulateur extends SubsystemBase { Moteuracc.setInverted(true); } public boolean limitswitch(){ - return limitacc.get(); + return photocellacc.get(); } public Accumulateur() { diff --git a/src/main/java/frc/robot/subsystem/Grimpeur.java b/src/main/java/frc/robot/subsystem/Grimpeur.java index 4f595c4..e2cbc93 100644 --- a/src/main/java/frc/robot/subsystem/Grimpeur.java +++ b/src/main/java/frc/robot/subsystem/Grimpeur.java @@ -8,9 +8,12 @@ import com.kauailabs.navx.frc.AHRS; import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkLowLevel.MotorType; +import edu.wpi.first.networktables.GenericEntry; import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.PneumaticsModuleType; +import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; +import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; @@ -18,7 +21,8 @@ import frc.robot.Constants; public class Grimpeur extends SubsystemBase { /** Creates a new Acrocheur. */ // moteur - public Grimpeur() {} + + ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard"); final CANSparkMax grimpeurd = new CANSparkMax(Constants.grimpeurd,MotorType.kBrushless); final CANSparkMax grimpeurg = new CANSparkMax(Constants.grimpeurg,MotorType.kBrushless); // limit switch @@ -27,6 +31,23 @@ public class Grimpeur extends SubsystemBase { final DoubleSolenoid pistondroite= new DoubleSolenoid(PneumaticsModuleType.CTREPCM, Constants.pistondroiteouvre, Constants.pistondroiteouvre); final DoubleSolenoid pistondgauche= new DoubleSolenoid(PneumaticsModuleType.CTREPCM, Constants.pistondgaucheouvre, Constants.pistondroiteouvre); //fonction + public Grimpeur() { + dashboard.add("limitgrimpeurd", droite()) + .withSize(1, 1) + .withPosition(1, 5); + dashboard.add("limitgrimpeurd", droite()) + .withSize(1, 1) + .withPosition(1, 4); + dashboard.add("grimpeurencodeurd", encoderd()) + .withSize(1, 1) + .withPosition(1, 3); + dashboard.add("grimpeurencodeurg", encoderg()) + .withSize(1, 1) + .withPosition(1, 2); + dashboard.add("pitchgyrogrimpeur", getpitch()) + .withSize(1, 1) + .withPosition(1, 1); + } public void droit(double vitesse){ grimpeurd.set(vitesse); } diff --git a/src/main/java/frc/robot/subsystem/Guideur.java b/src/main/java/frc/robot/subsystem/Guideur.java index 359a04c..c801259 100644 --- a/src/main/java/frc/robot/subsystem/Guideur.java +++ b/src/main/java/frc/robot/subsystem/Guideur.java @@ -7,17 +7,22 @@ package frc.robot.subsystem; import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; import edu.wpi.first.wpilibj.DigitalInput; +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; public class Guideur extends SubsystemBase { /** Creates a new Guideur. */ - public Guideur() {} + ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard"); final WPI_TalonSRX guideur = new WPI_TalonSRX(Constants.guideur); final DigitalInput guideurhaut = new DigitalInput(Constants.guideurhaut); final DigitalInput guideurbas = new DigitalInput(Constants.guideurbas); - + public Guideur() { + dashboard.add("limitguideurhaut", haut()); + dashboard.add("limitguideurbas", bas()); + } public void guider(double vitesse){ guideur.set(vitesse); }