This commit is contained in:
Olivier Dubois 2024-02-12 19:14:27 -05:00
commit 69afbb068a
35 changed files with 344 additions and 350 deletions

View File

@ -1,4 +1,14 @@
{
"FMS": {
"window": {
"visible": false
}
},
"System Joysticks": {
"window": {
"visible": false
}
},
"keyboardJoysticks": [
{
"axisConfig": [

View File

@ -4,6 +4,21 @@
"window": {
"visible": true
}
},
"Solenoids": {
"0": {
"header": {
"open": true
}
},
"window": {
"visible": true
}
},
"Timing": {
"window": {
"visible": false
}
}
},
"NTProvider": {
@ -14,6 +29,11 @@
"/SmartDashboard/Pigeon IMU [0]": "Gyro"
},
"windows": {
"/Shuffleboard/dashboard/autochooser": {
"window": {
"visible": true
}
},
"/SmartDashboard/Field": {
"bottom": 1476,
"height": 8.210550308227539,
@ -37,6 +57,9 @@
}
}
},
"NetworkTables Info": {
"visible": true
},
"NetworkTables View": {
"visible": false
},

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}
@ -65,17 +65,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}
@ -65,17 +65,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -65,17 +65,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}

View File

@ -15,24 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,24 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,24 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -47,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}

View File

@ -15,24 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -47,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}
@ -72,17 +65,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}

View File

@ -15,17 +15,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}
@ -40,17 +40,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "balyer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "balyer"
}
}
]
}
@ -65,17 +65,17 @@
"type": "deadline",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "lancer"
}
},
{
"type": "wait",
"data": {
"waitTime": 3.0
}
},
{
"type": "named",
"data": {
"name": "lancer"
}
}
]
}

View File

@ -23,8 +23,9 @@ import edu.wpi.first.wpilibj2.command.WaitCommand;
// Manettes
import edu.wpi.first.wpilibj2.command.button.CommandJoystick;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import frc.robot.command.AllumeLED;
// Commands
import frc.robot.command.AllumeLED;
import frc.robot.command.Balayer;
import frc.robot.command.GrimpeurDroit;
import frc.robot.command.GrimpeurGauche;
@ -70,8 +71,13 @@ public class RobotContainer {
LancerNote lancernote = new LancerNote(lanceur, accumulateur);
Lancerampli lancerampli = new Lancerampli(lanceur,limelight);
GrimpeurDroit grimpeurDroit = new GrimpeurDroit(grimpeur, manette::getLeftX);
<<<<<<< HEAD
GrimpeurGauche grimpeurGauche = new GrimpeurGauche(grimpeur, manette::getLeftY);
AllumeLED allumeLED = new AllumeLED(LED,accumulateur);
=======
GrimpeurGauche grimpeurGauche = new GrimpeurGauche(grimpeur, manette::getRightX);
AllumeLED allumeLED = new AllumeLED(LED, accumulateur);
>>>>>>> 7a37782ca19fb71cb842174cd8fcd536eda825a9
Pistongrimpeur pistongrimpeur = new Pistongrimpeur(grimpeur, LED);
public RobotContainer() {
dashboard.addCamera("limelight", "limelight","limelight.local:5800");
@ -92,8 +98,10 @@ public class RobotContainer {
drive.drive(-MathUtil.applyDeadband(joystick.getY(),0.2), MathUtil.applyDeadband(-joystick.getX(),0.2), MathUtil.applyDeadband(-joystick.getZ(), 0.2));
},drive));
grimpeur.setDefaultCommand(new RunCommand(()->{
grimpeur.droit(manette.getLeftX());}
grimpeur.droit(manette.getLeftX());
grimpeur.gauche(manette.getRightX());}
,grimpeur));
LED.setDefaultCommand(allumeLED);
dashboard.add("autochooser",autoChooser)
.withSize(2,1)

View File

@ -12,7 +12,7 @@ public class AllumeLED extends Command {
private LED led;
private Accumulateur accumulateur;
/** Creates a new AllumeLED. */
public AllumeLED(LED led,Accumulateur accumulateur) {
public AllumeLED(LED led,Accumulateur accumulateur){
this.accumulateur = accumulateur;
this.led = led;
addRequirements(led);

View File

@ -45,7 +45,7 @@ public class GrimpeurDroit extends Command {
else{
grimpeur.droit(0);
}
if(grimpeur.encoderd()>0){
if(grimpeur.encoderd()>1){
grimpeur.resetencodeurd();
grimpeur.droit(0);

View File

@ -44,7 +44,7 @@ public class GrimpeurGauche extends Command {
else{
grimpeur.gauche(0);
}
if(grimpeur.encoderd()>0){
if(grimpeur.encoderd()>1){
grimpeur.resetencodeurg();
grimpeur.gauche(0);

View File

@ -10,14 +10,12 @@ 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.Solenoid;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
@ -33,14 +31,11 @@ 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 DigitalInput limitdroite = new DigitalInput(Constants.limithaut);
final DigitalInput limitgauche = new DigitalInput(Constants.limitbas);
final Solenoid pistondroite= new Solenoid(PneumaticsModuleType.CTREPCM, Constants.pistondroiteouvre);
final Solenoid pistondgauche = new Solenoid(PneumaticsModuleType.CTREPCM, Constants.pistondgaucheouvre);
//fonction
public Grimpeur() {
layout.addBoolean("limitgrimpeurd", limitdroite::get);
layout.addBoolean("limitgrimpeurg", limitdroite::get);
pistonouvre();
layout.add("grimpeurencodeurd", encoderd());
layout.add("grimpeurencodeurg", encoderg());
layout.add("pitchgyrogrimpeur", getpitch());
@ -51,12 +46,6 @@ public void droit(double vitesse){
public void gauche(double vitesse){
grimpeurg.set(vitesse);
}
public boolean droite(){
return limitdroite.get();
}
public boolean gauche(){
return limitgauche.get();
}
public void resetencodeurd(){
grimpeurd.getEncoder().setPosition(0);
}
@ -84,14 +73,10 @@ public AHRS gyroscope = new AHRS();
public boolean piston(){
return pistondgauche.get();
}
@Override
@Override
public void periodic() {
// This method will be called once per scheduler run
if(droite()) {
resetencodeurd();
}
if(gauche()) {
resetencodeurg();
}
}
}

View File

@ -16,7 +16,6 @@ public class Limelight extends SubsystemBase {
NetworkTableEntry tx = table.getEntry("tx");
NetworkTableEntry ty = table.getEntry("ty");
NetworkTableEntry ta = table.getEntry("ta");
NetworkTableEntry pipeline = table.getEntry("pipeline");
NetworkTableEntry tv = table.getEntry("tv");
NetworkTableEntry camMode = table.getEntry("camMode");
@ -33,9 +32,6 @@ public class Limelight extends SubsystemBase {
public double gety(){
return ty.getDouble(0);
}
/* public double geta() {
return ta.getDouble(0);
}*/
public boolean getv(){
return tv.getBoolean(false);
}