Merge branch 'main' of https://git.demerso.net/pls5618/2024/robot
This commit is contained in:
commit
78454fd3f5
@ -48,5 +48,5 @@ public class Constants {
|
||||
public static int photocellacc = 2;
|
||||
|
||||
//piston
|
||||
public static int pistondroiteouvre= 7;
|
||||
public static int pistondroite= 7;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class RobotContainer {
|
||||
.withPosition(7,0);
|
||||
|
||||
dashboard.addCamera("USB Camera 0", "USB Camera 0","http://roborio-5618-frc.local:1181/?action=stream")
|
||||
.withSize(4, 4)
|
||||
.withSize(4, 3)
|
||||
.withPosition(3, 0);
|
||||
|
||||
CameraServer.startAutomaticCapture();
|
||||
@ -95,6 +95,7 @@ public class RobotContainer {
|
||||
joystick.button(4).whileTrue(new ParallelCommandGroup(new Lancer(lanceur,limelight),new Limelight_tracker(limelight,drive)));
|
||||
joystick.button(2).whileTrue(new ParallelCommandGroup(new Lancerampli(lanceur,limelight),new Limelight_tracker(limelight,drive)));
|
||||
joystick.button(6).whileTrue(new LancerTrape(lanceur, accumulateur));
|
||||
joystick.button(7).whileTrue(new Limelight_tracker(limelight, drive));
|
||||
// deplacement
|
||||
configureBindings();
|
||||
drive.setDefaultCommand(new RunCommand(()->{
|
||||
@ -108,8 +109,8 @@ public class RobotContainer {
|
||||
,grimpeur));
|
||||
|
||||
dashboard.add("autochooser",autoChooser)
|
||||
.withSize(2,1)
|
||||
.withPosition(1,1);
|
||||
.withSize(1,1)
|
||||
.withPosition(2,2);
|
||||
}
|
||||
|
||||
private void configureBindings() {}
|
||||
|
@ -20,7 +20,7 @@ public class Accumulateur extends SubsystemBase {
|
||||
private GenericEntry vitesse =
|
||||
dashboard.add("vitesseacc", 0.5)
|
||||
.withSize(1, 1)
|
||||
.withPosition(2, 2)
|
||||
.withPosition(0, 0)
|
||||
.getEntry();
|
||||
final WPI_TalonSRX Moteuracc2 = new WPI_TalonSRX(Constants.Moteuracc2);
|
||||
final WPI_TalonSRX Moteuracc = new WPI_TalonSRX(Constants.Moteuracc);
|
||||
@ -34,7 +34,7 @@ public class Accumulateur extends SubsystemBase {
|
||||
|
||||
dashboard.addBoolean("limitacc", this::limitswitch)
|
||||
.withSize(1, 1)
|
||||
.withPosition(2, 0);
|
||||
.withPosition(0, 1);
|
||||
}
|
||||
public void Accumuler(double vitesse){
|
||||
Moteuracc.set(-vitesse);
|
||||
|
@ -28,7 +28,7 @@ public class Grimpeur extends SubsystemBase {
|
||||
final CANSparkMax grimpeurd = new CANSparkMax(Constants.grimpeurd,MotorType.kBrushless);
|
||||
final CANSparkMax grimpeurg = new CANSparkMax(Constants.grimpeurg,MotorType.kBrushless);
|
||||
// limit switch
|
||||
final Solenoid pistondroite= new Solenoid(PneumaticsModuleType.REVPH, Constants.pistondroiteouvre);
|
||||
final Solenoid pistondroite= new Solenoid(PneumaticsModuleType.REVPH, Constants.pistondroite);
|
||||
//fonction
|
||||
public Grimpeur() {
|
||||
pistonouvre();
|
||||
|
@ -23,10 +23,10 @@ public class Guideur extends SubsystemBase {
|
||||
public Guideur() {
|
||||
dashboard.addBoolean("limitguideurhaut", guideurhaut::get)
|
||||
.withSize(1,1)
|
||||
.withPosition(0,0);
|
||||
.withPosition(1,1);
|
||||
dashboard.addBoolean("limitguideurbas", guideurbas::get)
|
||||
.withSize(1,1)
|
||||
.withPosition(1,0);
|
||||
.withPosition(2,1);
|
||||
}
|
||||
public void guider(double vitesse){
|
||||
guideur.set(vitesse);
|
||||
|
@ -12,7 +12,6 @@ import edu.wpi.first.units.Measure;
|
||||
import edu.wpi.first.units.MutableMeasure;
|
||||
import edu.wpi.first.units.Velocity;
|
||||
import edu.wpi.first.units.Voltage;
|
||||
import edu.wpi.first.wpilibj.RobotController;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
||||
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
@ -29,12 +28,12 @@ public class Lanceur extends SubsystemBase {
|
||||
private GenericEntry vitesse =
|
||||
dashboard.add("vitesse", 0.8)
|
||||
.withSize(1, 1)
|
||||
.withPosition(2,1)
|
||||
.getEntry();
|
||||
private GenericEntry vitesseamp =
|
||||
.withPosition(2,0)
|
||||
.getEntry();
|
||||
private GenericEntry vitesseamp =
|
||||
dashboard.add("vitesseamp", 0.1)
|
||||
.withSize(1, 1)
|
||||
.withPosition(2,3)
|
||||
.withPosition(1,0)
|
||||
.getEntry();
|
||||
public Lanceur() {
|
||||
|
||||
|
@ -24,12 +24,12 @@ public class Limelight extends SubsystemBase {
|
||||
/** Creates a new Limelight. */
|
||||
public Limelight() {
|
||||
for (int port = 5800; port <= 5807; port++) {
|
||||
PortForwarder.add(port, "limelight.local", port);
|
||||
}
|
||||
PortForwarder.add(port, "limelight.local", port);
|
||||
}
|
||||
}
|
||||
|
||||
public double getx(){
|
||||
return tx.getDouble(0);
|
||||
return tx.getDouble(0);
|
||||
}
|
||||
public double gety(){
|
||||
return ty.getDouble(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user