This commit is contained in:
Olivier Dubois 2023-03-08 20:06:28 -05:00
parent fc4607f3c6
commit cef96749f4
3 changed files with 11 additions and 8 deletions

View File

@ -2,7 +2,7 @@ package frc.robot;
public class Constants {
public static int avantdroit = 1;
public static int avantgauche = 4;
public static int avantgauche = 2;
public static int arrieredroit = 3;
public static int arrieregauche = 5;
public static int BrasTelescopique = 4;
@ -11,7 +11,7 @@ public class Constants {
//moteur
public static int leverGratte = 0;
public static int baiserGratte = 1;
public static int baisserGratte = 1;
public static int baisserGratte = 2;
// pneumatique
public static int pistonpinceouvre = 0;

View File

@ -3,7 +3,11 @@
// the WPILib BSD license file in the root directory of this project.
package frc.robot;
import org.photonvision.estimation.CameraTargetRelation;
import edu.wpi.first.cameraserver.CameraServer;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.RunCommand;
@ -66,10 +70,11 @@ PivotChercheHaut pivotChercheHaut = new PivotChercheHaut(brasTelescopique, pivot
Cube cube = new Cube(limelight, basePilotable, null);
Apriltag aprilTag = new Apriltag(limelight, basePilotable, null);
Tape tape = new Tape(limelight, basePilotable, null);
ShuffleboardTab teb = Shuffleboard.getTab("teb");
public RobotContainer() {
configureBindings();
CameraServer.startAutomaticCapture();
teb.add (CameraServer.startAutomaticCapture(null, 0));
basePilotable.setDefaultCommand(new RunCommand(() -> {
basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), 0);
},basePilotable));
@ -77,9 +82,6 @@ public RobotContainer() {
}
private void configureBindings() {
basePilotable.setDefaultCommand(new RunCommand(() -> {
basePilotable.drive(-manette1.getLeftY(), -manette1.getLeftX(), 0);
},basePilotable));
// manette 1
manette1.povDown().onTrue(pivoteBrasHaut);
manette1.povUp().onTrue(pivoteBrasBas);

View File

@ -23,7 +23,8 @@ public class BrasTelescopique extends SubsystemBase {
public BrasTelescopique() {
teb .add("photocell",0.1);
teb .add("winch",0.1);
teb .add("encodeur",0.1);}
teb .add("encodeur",0.1);
}
final CANSparkMax Winch = new CANSparkMax(Constants.BrasTelescopique,MotorType.kBrushless);
private DigitalInput photocell = new DigitalInput(Constants.photocell);
private DoubleSolenoid brakewinch = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakewinchf, Constants.brakewinchb);