From d709f194b4b81ae2e8a04cf77e316e0b2cfa1534 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Wed, 11 Dec 2024 18:06:10 -0500 Subject: [PATCH 1/4] roues rouges et bleus + Ids --- .../java/frc/robot/Subsystems/Accumulateur.java | 15 ++++++++++++--- src/main/java/frc/robot/Subsystems/Lanceur.java | 6 +++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/main/java/frc/robot/Subsystems/Accumulateur.java b/src/main/java/frc/robot/Subsystems/Accumulateur.java index 9606b3a..d93ed78 100644 --- a/src/main/java/frc/robot/Subsystems/Accumulateur.java +++ b/src/main/java/frc/robot/Subsystems/Accumulateur.java @@ -23,8 +23,10 @@ public class Accumulateur extends SubsystemBase { .withPosition(0, 0) .getEntry(); - final WPI_TalonSRX strap = new WPI_TalonSRX(0); - final WPI_TalonSRX roueRouge = new WPI_TalonSRX(10); + final WPI_TalonSRX strap = new WPI_TalonSRX(16); + final WPI_TalonSRX rouesbleues = new WPI_TalonSRX(21); + final WPI_TalonSRX roueRouge1 = new WPI_TalonSRX(14); + final WPI_TalonSRX roueRouge2 = new WPI_TalonSRX(22); final DigitalInput photocell = new DigitalInput(20); final DigitalInput photocell2 = new DigitalInput(21); public void encodeur(){ @@ -39,8 +41,15 @@ public class Accumulateur extends SubsystemBase { strap.set(vitesse); } + public void masterslave(){ + roueRouge2.follow(roueRouge1); + roueRouge1.setInverted(true); + } + public void masterslave2(){ + rouesbleues.follow(strap); + } public void Petitlanceur(double vitesse){ - roueRouge.set(vitesse); + roueRouge1.set(vitesse); } public void desaccumule(){ diff --git a/src/main/java/frc/robot/Subsystems/Lanceur.java b/src/main/java/frc/robot/Subsystems/Lanceur.java index c80ae5d..115140c 100644 --- a/src/main/java/frc/robot/Subsystems/Lanceur.java +++ b/src/main/java/frc/robot/Subsystems/Lanceur.java @@ -31,8 +31,8 @@ public class Lanceur extends SubsystemBase { } ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard"); - final WPI_TalonSRX lanceur1 = new WPI_TalonSRX(0); - final WPI_TalonSRX lanceur2 = new WPI_TalonSRX(1); + final WPI_TalonSRX lanceur1 = new WPI_TalonSRX(17); + final WPI_TalonSRX lanceur2 = new WPI_TalonSRX(15); final CANSparkMax tourelle = new CANSparkMax(2, MotorType.kBrushless); final DigitalInput limitswitch1 = new DigitalInput(0); final DigitalInput limitswitch2 = new DigitalInput(1); @@ -55,7 +55,7 @@ public class Lanceur extends SubsystemBase { } public void masterslave(){ lanceur2.follow(lanceur1); - lanceur2.setInverted(true); + lanceur1.setInverted(true); } public void lance(double vitesse){ lanceur1.set(vitesse); From cdb294760030c59a1ac6611feda2ad810dea7d9f Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Wed, 11 Dec 2024 18:07:50 -0500 Subject: [PATCH 2/4] --- src/main/java/frc/robot/Subsystems/Accumulateur.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/Subsystems/Accumulateur.java b/src/main/java/frc/robot/Subsystems/Accumulateur.java index d93ed78..cd05cd7 100644 --- a/src/main/java/frc/robot/Subsystems/Accumulateur.java +++ b/src/main/java/frc/robot/Subsystems/Accumulateur.java @@ -28,7 +28,7 @@ public class Accumulateur extends SubsystemBase { final WPI_TalonSRX roueRouge1 = new WPI_TalonSRX(14); final WPI_TalonSRX roueRouge2 = new WPI_TalonSRX(22); final DigitalInput photocell = new DigitalInput(20); - final DigitalInput photocell2 = new DigitalInput(21); + final DigitalInput photocell2 = new DigitalInput(27); public void encodeur(){ } public boolean photocell(){ From 99c50dc4fc397e1393249ff5d0ee9463966bfebf Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Wed, 11 Dec 2024 18:45:09 -0500 Subject: [PATCH 3/4] desaccumuler mode auto --- src/main/deploy/pathplanner/autos/mode 1.auto | 6 ++++++ src/main/java/frc/robot/RobotContainer.java | 1 + 2 files changed, 7 insertions(+) diff --git a/src/main/deploy/pathplanner/autos/mode 1.auto b/src/main/deploy/pathplanner/autos/mode 1.auto index 1934679..836382d 100644 --- a/src/main/deploy/pathplanner/autos/mode 1.auto +++ b/src/main/deploy/pathplanner/autos/mode 1.auto @@ -27,6 +27,12 @@ "waitTime": 2.0 } }, + { + "type": "named", + "data": { + "name": "lancer" + } + }, { "type": "named", "data": { diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 50c1543..29eff46 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -32,6 +32,7 @@ public class RobotContainer { CommandXboxController manette = new CommandXboxController(0); public RobotContainer() { NamedCommands.registerCommand("lancer", new Lancer(lanceur, accumulateur)); + NamedCommands.registerCommand("Desaccumuler", new Desaccumuler(accumulateur)); autoChooser = AutoBuilder.buildAutoChooser(); dashboard.addCamera("limelight3G", "limelight3G","limelight.local:5800") .withSize(3,4) From a0dc53800fde891d45bd55416cdb6b022b8fcb24 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Wed, 11 Dec 2024 18:49:06 -0500 Subject: [PATCH 4/4] mode auto 1 --- src/main/deploy/pathplanner/autos/mode 1.auto | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/deploy/pathplanner/autos/mode 1.auto b/src/main/deploy/pathplanner/autos/mode 1.auto index 836382d..56b97ae 100644 --- a/src/main/deploy/pathplanner/autos/mode 1.auto +++ b/src/main/deploy/pathplanner/autos/mode 1.auto @@ -33,6 +33,12 @@ "name": "lancer" } }, + { + "type": "wait", + "data": { + "waitTime": 1.0 + } + }, { "type": "named", "data": { @@ -58,6 +64,18 @@ "waitTime": 2.0 } }, + { + "type": "named", + "data": { + "name": "lancer" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.0 + } + }, { "type": "named", "data": {