ds
This commit is contained in:
parent
fc4607f3c6
commit
cef96749f4
@ -2,7 +2,7 @@ package frc.robot;
|
|||||||
|
|
||||||
public class Constants {
|
public class Constants {
|
||||||
public static int avantdroit = 1;
|
public static int avantdroit = 1;
|
||||||
public static int avantgauche = 4;
|
public static int avantgauche = 2;
|
||||||
public static int arrieredroit = 3;
|
public static int arrieredroit = 3;
|
||||||
public static int arrieregauche = 5;
|
public static int arrieregauche = 5;
|
||||||
public static int BrasTelescopique = 4;
|
public static int BrasTelescopique = 4;
|
||||||
@ -11,7 +11,7 @@ public class Constants {
|
|||||||
//moteur
|
//moteur
|
||||||
public static int leverGratte = 0;
|
public static int leverGratte = 0;
|
||||||
public static int baiserGratte = 1;
|
public static int baiserGratte = 1;
|
||||||
public static int baisserGratte = 1;
|
public static int baisserGratte = 2;
|
||||||
|
|
||||||
// pneumatique
|
// pneumatique
|
||||||
public static int pistonpinceouvre = 0;
|
public static int pistonpinceouvre = 0;
|
||||||
|
@ -3,7 +3,11 @@
|
|||||||
// the WPILib BSD license file in the root directory of this project.
|
// the WPILib BSD license file in the root directory of this project.
|
||||||
|
|
||||||
package frc.robot;
|
package frc.robot;
|
||||||
|
import org.photonvision.estimation.CameraTargetRelation;
|
||||||
|
|
||||||
import edu.wpi.first.cameraserver.CameraServer;
|
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.Command;
|
||||||
import edu.wpi.first.wpilibj2.command.Commands;
|
import edu.wpi.first.wpilibj2.command.Commands;
|
||||||
import edu.wpi.first.wpilibj2.command.RunCommand;
|
import edu.wpi.first.wpilibj2.command.RunCommand;
|
||||||
@ -66,20 +70,18 @@ PivotChercheHaut pivotChercheHaut = new PivotChercheHaut(brasTelescopique, pivot
|
|||||||
Cube cube = new Cube(limelight, basePilotable, null);
|
Cube cube = new Cube(limelight, basePilotable, null);
|
||||||
Apriltag aprilTag = new Apriltag(limelight, basePilotable, null);
|
Apriltag aprilTag = new Apriltag(limelight, basePilotable, null);
|
||||||
Tape tape = new Tape(limelight, basePilotable, null);
|
Tape tape = new Tape(limelight, basePilotable, null);
|
||||||
|
ShuffleboardTab teb = Shuffleboard.getTab("teb");
|
||||||
public RobotContainer() {
|
public RobotContainer() {
|
||||||
configureBindings();
|
configureBindings();
|
||||||
CameraServer.startAutomaticCapture();
|
CameraServer.startAutomaticCapture();
|
||||||
basePilotable.setDefaultCommand(new RunCommand(() -> {
|
teb.add (CameraServer.startAutomaticCapture(null, 0));
|
||||||
|
basePilotable.setDefaultCommand(new RunCommand(() -> {
|
||||||
basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), 0);
|
basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), 0);
|
||||||
},basePilotable));
|
},basePilotable));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureBindings() {
|
private void configureBindings() {
|
||||||
basePilotable.setDefaultCommand(new RunCommand(() -> {
|
|
||||||
basePilotable.drive(-manette1.getLeftY(), -manette1.getLeftX(), 0);
|
|
||||||
},basePilotable));
|
|
||||||
// manette 1
|
// manette 1
|
||||||
manette1.povDown().onTrue(pivoteBrasHaut);
|
manette1.povDown().onTrue(pivoteBrasHaut);
|
||||||
manette1.povUp().onTrue(pivoteBrasBas);
|
manette1.povUp().onTrue(pivoteBrasBas);
|
||||||
|
@ -23,7 +23,8 @@ public class BrasTelescopique extends SubsystemBase {
|
|||||||
public BrasTelescopique() {
|
public BrasTelescopique() {
|
||||||
teb .add("photocell",0.1);
|
teb .add("photocell",0.1);
|
||||||
teb .add("winch",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);
|
final CANSparkMax Winch = new CANSparkMax(Constants.BrasTelescopique,MotorType.kBrushless);
|
||||||
private DigitalInput photocell = new DigitalInput(Constants.photocell);
|
private DigitalInput photocell = new DigitalInput(Constants.photocell);
|
||||||
private DoubleSolenoid brakewinch = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakewinchf, Constants.brakewinchb);
|
private DoubleSolenoid brakewinch = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakewinchf, Constants.brakewinchb);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user