Merge branch 'main' of https://demerso.net/pls5618/2023/robot
This commit is contained in:
commit
d4fc0d5497
Binary file not shown.
@ -2,15 +2,24 @@ 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 = 2;
|
||||
public static int pivot = 6;
|
||||
|
||||
//moteur
|
||||
<<<<<<< HEAD
|
||||
public static int leverGratte = 7;
|
||||
public static int baiserGratte = 8;
|
||||
=======
|
||||
public static int leverGratte = 0;
|
||||
public static int baiserGratte = 1;
|
||||
<<<<<<< HEAD
|
||||
public static int baisserGratte = 2;
|
||||
=======
|
||||
>>>>>>> 23806ebfa2db43d63673f9b4cfc37aa3b9b23491
|
||||
>>>>>>> feb8cc033e5eefa2d6b104c4ab7de16e0527fc5f
|
||||
|
||||
// pneumatique
|
||||
public static int pistonpinceouvre = 0;
|
||||
|
@ -3,13 +3,19 @@
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot;
|
||||
import java.util.Map;
|
||||
import org.photonvision.estimation.CameraTargetRelation;
|
||||
|
||||
import edu.wpi.first.cameraserver.CameraServer;
|
||||
<<<<<<< HEAD
|
||||
import edu.wpi.first.networktables.GenericEntry;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.BuiltInWidgets;
|
||||
=======
|
||||
>>>>>>> feb8cc033e5eefa2d6b104c4ab7de16e0527fc5f
|
||||
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
|
||||
import java.util.Map;
|
||||
import edu.wpi.first.networktables.GenericEntry;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
@ -82,6 +88,13 @@ Cone cone = new Cone(limelight, basePilotable, ()->-manette1.getLeftY());
|
||||
Reculer reculers = new Reculer(basePilotable, ()->reculerdistances.getDouble(0));
|
||||
Reculer reculerb = new Reculer(basePilotable, ()->reculerdistanceb.getDouble(0));
|
||||
Avancer avancer = new Avancer(basePilotable, ()->avancerdistance.getDouble(0));
|
||||
PivotChercheBas pivotChercheBas = new PivotChercheBas(brasTelescopique, pivot);
|
||||
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");
|
||||
Reculer reculer = new Reculer(basePilotable);
|
||||
|
||||
public RobotContainer() {
|
||||
chooser.setDefaultOption(enhaut, enhaut);
|
||||
@ -92,14 +105,18 @@ public RobotContainer() {
|
||||
|
||||
|
||||
configureBindings();
|
||||
|
||||
basePilotable.setDefaultCommand(new RunCommand(() -> {
|
||||
basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX());
|
||||
},basePilotable));
|
||||
|
||||
}
|
||||
|
||||
CameraServer.startAutomaticCapture();
|
||||
teb.add (CameraServer.startAutomaticCapture(null, 0));
|
||||
basePilotable.setDefaultCommand(new RunCommand() -> {
|
||||
basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), 0);
|
||||
}
|
||||
}
|
||||
private void configureBindings() {
|
||||
// manette 1
|
||||
manette1.povDown().onTrue(pivoteBrasHaut);
|
||||
manette1.povUp().onTrue(pivoteBrasBas);
|
||||
manette1.povLeft().onTrue(pivoteBrasMilieux);
|
||||
manette1.povRight().onTrue(pivotBrasRentre);
|
||||
manette1.a().toggleOnTrue(Commands.startEnd(pince::ouvrir, pince::fermer,pince));
|
||||
manette1.x().toggleOnTrue(Commands.startEnd(basePilotable::BrakeFerme,basePilotable::BrakeOuvre,basePilotable));
|
||||
manette1.y().whileTrue(gyro);
|
||||
|
@ -32,7 +32,8 @@ ShuffleboardLayout bras = Shuffleboard.getTab("teb")
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user