From 4c00d739a05c7a6118518d452eaa5fe1e857a895 Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Mon, 14 Nov 2022 18:42:35 -0500 Subject: [PATCH 01/14] jsg --- simgui-ds.json | 92 +++++++++++++++++++ simgui.json | 8 ++ .../java/frc/robot/subsystems/Pousser.java | 20 ++++ 3 files changed, 120 insertions(+) create mode 100644 simgui-ds.json create mode 100644 simgui.json create mode 100644 src/main/java/frc/robot/subsystems/Pousser.java diff --git a/simgui-ds.json b/simgui-ds.json new file mode 100644 index 0000000..73cc713 --- /dev/null +++ b/simgui-ds.json @@ -0,0 +1,92 @@ +{ + "keyboardJoysticks": [ + { + "axisConfig": [ + { + "decKey": 65, + "incKey": 68 + }, + { + "decKey": 87, + "incKey": 83 + }, + { + "decKey": 69, + "decayRate": 0.0, + "incKey": 82, + "keyRate": 0.009999999776482582 + } + ], + "axisCount": 3, + "buttonCount": 4, + "buttonKeys": [ + 90, + 88, + 67, + 86 + ], + "povConfig": [ + { + "key0": 328, + "key135": 323, + "key180": 322, + "key225": 321, + "key270": 324, + "key315": 327, + "key45": 329, + "key90": 326 + } + ], + "povCount": 1 + }, + { + "axisConfig": [ + { + "decKey": 74, + "incKey": 76 + }, + { + "decKey": 73, + "incKey": 75 + } + ], + "axisCount": 2, + "buttonCount": 4, + "buttonKeys": [ + 77, + 44, + 46, + 47 + ], + "povCount": 0 + }, + { + "axisConfig": [ + { + "decKey": 263, + "incKey": 262 + }, + { + "decKey": 265, + "incKey": 264 + } + ], + "axisCount": 2, + "buttonCount": 6, + "buttonKeys": [ + 260, + 268, + 266, + 261, + 269, + 267 + ], + "povCount": 0 + }, + { + "axisCount": 0, + "buttonCount": 0, + "povCount": 0 + } + ] +} diff --git a/simgui.json b/simgui.json new file mode 100644 index 0000000..3eb1897 --- /dev/null +++ b/simgui.json @@ -0,0 +1,8 @@ +{ + "NTProvider": { + "types": { + "/FMSInfo": "FMSInfo", + "/LiveWindow/Ungrouped/Scheduler": "Scheduler" + } + } +} diff --git a/src/main/java/frc/robot/subsystems/Pousser.java b/src/main/java/frc/robot/subsystems/Pousser.java new file mode 100644 index 0000000..5627d26 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/Pousser.java @@ -0,0 +1,20 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.subsystems; + +import edu.wpi.first.wpilibj.DoubleSolenoid; +import edu.wpi.first.wpilibj.PneumaticsModuleType; +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +public class Pousser extends SubsystemBase { + private DoubleSolenoid pousser = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,0,1); + /** Creates a new Pousser. */ + public Pousser() {} + + @Override + public void periodic() { + // This method will be called once per scheduler run + } +} From aaf5c7c033968366a459fead8e0657c94dcb73ad Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Mon, 14 Nov 2022 18:51:31 -0500 Subject: [PATCH 02/14] adf --- src/main/java/frc/robot/Constants.java | 5 ++++- src/main/java/frc/robot/subsystems/Pousser.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 033c72d..c137333 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -12,4 +12,7 @@ package frc.robot; *

It is advised to statically import this class (or one of its inner classes) wherever the * constants are needed, to reduce verbosity. */ -public final class Constants {} +public final class Constants { + public static final int PistonPousserR = 0; + public static final int PistonPousserF = 1; +} diff --git a/src/main/java/frc/robot/subsystems/Pousser.java b/src/main/java/frc/robot/subsystems/Pousser.java index 5627d26..2c3b985 100644 --- a/src/main/java/frc/robot/subsystems/Pousser.java +++ b/src/main/java/frc/robot/subsystems/Pousser.java @@ -9,6 +9,7 @@ import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj2.command.SubsystemBase; public class Pousser extends SubsystemBase { + private DoubleSolenoid pousser = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,0,1); /** Creates a new Pousser. */ public Pousser() {} From 4708c8526b91ee8f2b3c5803cc0178e65ce3c878 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Mon, 14 Nov 2022 19:15:41 -0500 Subject: [PATCH 03/14] Base pilotable --- src/main/java/frc/robot/Constants.java | 5 + .../frc/robot/subsystems/BasePilotable.java | 35 +++ .../pistonshaker.java | 2 +- vendordeps/Phoenix.json | 257 ++++++++++++++++++ 4 files changed, 298 insertions(+), 1 deletion(-) create mode 100644 src/main/java/frc/robot/subsystems/BasePilotable.java rename src/main/java/frc/robot/{subsystem => subsystems}/pistonshaker.java (94%) create mode 100644 vendordeps/Phoenix.json diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 033c72d..6bfafd0 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -13,3 +13,8 @@ package frc.robot; * constants are needed, to reduce verbosity. */ public final class Constants {} + +private static final int MoteurAvantGauche = (0); +private static final int MoteurAvantDroit = (0); +private static final int MoteurArriereDroit = (0); +private static final int MoteurArriereDroit = (0); \ No newline at end of file diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java new file mode 100644 index 0000000..4a1466d --- /dev/null +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -0,0 +1,35 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.subsystems; + +import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; + +import edu.wpi.first.wpilibj.drive.MecanumDrive; +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +public class BasePilotable extends SubsystemBase { + + +private WPI_TalonSRX avantGauche = new WPI_TalonSRX(Constants.MoteurAvantGauche); + +private WPI_TalonSRX avantDroit = new WPI_TalonSRX(Constants.MoteurAvantDroit); + +private WPI_TalonSRX arriereGauche = new WPI_TalonSRX(Constants.MoteurArriereGauche); + +private WPI_TalonSRX arriereDroit = new WPI_TalonSRX(Constants.MoteurArriereDroit); + +private MecanumDrive mecanum = new MecanumDrive(avntGauche, arriereGauche, avantDroit, arriereDroit); + +private void Drive(double y, double x, double rot){ + drive.driveCarthesian(y, x, rot, 0) +} + /** Creates a new BasePilotable. */ + public BasePilotable() {} + + @Override + public void periodic() { + // This method will be called once per scheduler run + } +} diff --git a/src/main/java/frc/robot/subsystem/pistonshaker.java b/src/main/java/frc/robot/subsystems/pistonshaker.java similarity index 94% rename from src/main/java/frc/robot/subsystem/pistonshaker.java rename to src/main/java/frc/robot/subsystems/pistonshaker.java index 0157b86..2c98da3 100644 --- a/src/main/java/frc/robot/subsystem/pistonshaker.java +++ b/src/main/java/frc/robot/subsystems/pistonshaker.java @@ -2,7 +2,7 @@ // Open Source Software; you can modify and/or share it under the terms of // the WPILib BSD license file in the root directory of this project. -package frc.robot.subsystem; +package frc.robot.subsystems; import edu.wpi.first.wpilibj2.command.SubsystemBase; diff --git a/vendordeps/Phoenix.json b/vendordeps/Phoenix.json new file mode 100644 index 0000000..d6265f8 --- /dev/null +++ b/vendordeps/Phoenix.json @@ -0,0 +1,257 @@ +{ + "fileName": "Phoenix.json", + "name": "CTRE-Phoenix", + "version": "5.21.4", + "frcYear": 2022, + "uuid": "ab676553-b602-441f-a38d-f1296eff6537", + "mavenUrls": [ + "https://maven.ctr-electronics.com/release/" + ], + "jsonUrl": "https://maven.ctr-electronics.com/release/com/ctre/phoenix/Phoenix-frc2022-latest.json", + "javaDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-java", + "version": "5.21.4" + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-java", + "version": "5.21.4" + } + ], + "jniDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.21.4", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "linuxathena" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "cci-sim", + "version": "5.21.4", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simTalonSRX", + "version": "5.21.4", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simTalonFX", + "version": "5.21.4", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simVictorSPX", + "version": "5.21.4", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simPigeonIMU", + "version": "5.21.4", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simCANCoder", + "version": "5.21.4", + "isJar": false, + "skipInvalidPlatforms": true, + "validPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + } + ], + "cppDependencies": [ + { + "groupId": "com.ctre.phoenix", + "artifactId": "wpiapi-cpp", + "version": "5.21.4", + "libName": "CTRE_Phoenix_WPI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ] + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "api-cpp", + "version": "5.21.4", + "libName": "CTRE_Phoenix", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ] + }, + { + "groupId": "com.ctre.phoenix", + "artifactId": "cci", + "version": "5.21.4", + "libName": "CTRE_PhoenixCCI", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "linuxathena" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "wpiapi-cpp-sim", + "version": "5.21.4", + "libName": "CTRE_Phoenix_WPISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "api-cpp-sim", + "version": "5.21.4", + "libName": "CTRE_PhoenixSim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "cci-sim", + "version": "5.21.4", + "libName": "CTRE_PhoenixCCISim", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simTalonSRX", + "version": "5.21.4", + "libName": "CTRE_SimTalonSRX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simTalonFX", + "version": "5.21.4", + "libName": "CTRE_SimTalonFX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simVictorSPX", + "version": "5.21.4", + "libName": "CTRE_SimVictorSPX", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simPigeonIMU", + "version": "5.21.4", + "libName": "CTRE_SimPigeonIMU", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + }, + { + "groupId": "com.ctre.phoenix.sim", + "artifactId": "simCANCoder", + "version": "5.21.4", + "libName": "CTRE_SimCANCoder", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxx86-64", + "osxx86-64" + ] + } + ] +} \ No newline at end of file From 883c6e5708f21d97f098ca308ec6a5b9315c56ec Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Mon, 14 Nov 2022 19:26:16 -0500 Subject: [PATCH 04/14] creer commande --- .../frc/robot/commands/Activer_poussoir.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/main/java/frc/robot/commands/Activer_poussoir.java diff --git a/src/main/java/frc/robot/commands/Activer_poussoir.java b/src/main/java/frc/robot/commands/Activer_poussoir.java new file mode 100644 index 0000000..f40f96f --- /dev/null +++ b/src/main/java/frc/robot/commands/Activer_poussoir.java @@ -0,0 +1,34 @@ +// Copyright (c) FIRST and other WPILib contributors. +// Open Source Software; you can modify and/or share it under the terms of +// the WPILib BSD license file in the root directory of this project. + +package frc.robot.commands; + +import edu.wpi.first.wpilibj2.command.CommandBase; + +public class Activer_poussoir extends CommandBase { + /** Creates a new Activer_poussoir. */ + public Activer_poussoir() { + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() {} + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() {} + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) {} + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return false; + } +} + + From 1887e39bed79c9b084efe6c6e09adddff8a59505 Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Mon, 14 Nov 2022 19:26:53 -0500 Subject: [PATCH 05/14] aet --- src/main/java/frc/robot/subsystems/Pousser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/Pousser.java b/src/main/java/frc/robot/subsystems/Pousser.java index 2c3b985..e619dad 100644 --- a/src/main/java/frc/robot/subsystems/Pousser.java +++ b/src/main/java/frc/robot/subsystems/Pousser.java @@ -7,10 +7,11 @@ package frc.robot.subsystems; import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.Constants; public class Pousser extends SubsystemBase { - private DoubleSolenoid pousser = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,0,1); + private DoubleSolenoid pousser = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.PistonPousserR,Constants.PistonPousserF ); /** Creates a new Pousser. */ public Pousser() {} From 6de777002554c4de5a8b12deda4815042679bb11 Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Mon, 14 Nov 2022 19:40:18 -0500 Subject: [PATCH 06/14] cmd --- .../{Pousser.java => Poussoir.java} | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) rename src/main/java/frc/robot/subsystems/{Pousser.java => Poussoir.java} (72%) diff --git a/src/main/java/frc/robot/subsystems/Pousser.java b/src/main/java/frc/robot/subsystems/Poussoir.java similarity index 72% rename from src/main/java/frc/robot/subsystems/Pousser.java rename to src/main/java/frc/robot/subsystems/Poussoir.java index e619dad..7774e23 100644 --- a/src/main/java/frc/robot/subsystems/Pousser.java +++ b/src/main/java/frc/robot/subsystems/Poussoir.java @@ -9,11 +9,27 @@ import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; -public class Pousser extends SubsystemBase { +public class Poussoir extends SubsystemBase { + private DoubleSolenoid pousser = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.PistonPousserR,Constants.PistonPousserF ); + + /** Creates a new Poussoir. */ + public Poussoir() { + + } + + public void pousser(){ + + } + public void bloquer(){ + + } + public void debloque(){ + + } + public void tirer(){ + + } - private DoubleSolenoid pousser = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.PistonPousserR,Constants.PistonPousserF ); - /** Creates a new Pousser. */ - public Pousser() {} @Override public void periodic() { From de18ce196167b2f81f0ebc0c659f691271c33ecf Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Mon, 14 Nov 2022 19:46:09 -0500 Subject: [PATCH 07/14] Base pilotable --- src/main/java/frc/robot/Constants.java | 3 +-- .../frc/robot/subsystems/BasePilotable.java | 2 +- .../frc/robot/subsystems/pistonshaker.java | 19 +++++++++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index d072e77..e97c61e 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -16,10 +16,9 @@ package frc.robot; */ <<<<<<< HEAD public final class Constants {} - private static final int MoteurAvantGauche = (0); private static final int MoteurAvantDroit = (0); -private static final int MoteurArriereDroit = (0); +private static final int MoteurArriereGauche = (0); private static final int MoteurArriereDroit = (0); ======= public final class Constants { diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index 7b7ec66..eaaa4bd 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -23,7 +23,7 @@ private WPI_TalonSRX arriereDroit = new WPI_TalonSRX(Constants.MoteurArriereDroi private MecanumDrive mecanum = new MecanumDrive(avantGauche, arriereGauche, avantDroit, arriereDroit); private void Drive(double y, double x, double rot){ - drive.driveCarthesian(y, x, rot, 0) + drive.driveCarthesian(y, x, rot, 0); } /** Creates a new BasePilotable. */ public BasePilotable() {} diff --git a/src/main/java/frc/robot/subsystems/pistonshaker.java b/src/main/java/frc/robot/subsystems/pistonshaker.java index 2c98da3..5599ac6 100644 --- a/src/main/java/frc/robot/subsystems/pistonshaker.java +++ b/src/main/java/frc/robot/subsystems/pistonshaker.java @@ -4,14 +4,29 @@ package frc.robot.subsystems; +import edu.wpi.first.wpilibj.DoubleSolenoid; +import edu.wpi.first.wpilibj.PneumaticsModuleType; +import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.Constants; -public class pistonshaker extends SubsystemBase { +public class Pistonshaker extends SubsystemBase { + private DoubleSolenoid shaker = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.pistonQuiShakef,Constants.pistonQuiShakeb); /** Creates a new pistonshaker. */ - public pistonshaker() {} + public Pistonshaker() { + + } +public void sortirpiston() { + shaker.set(Value.kForward); +} +public void rentrerpiston() { + shaker.set(Value.kReverse); + } + @Override public void periodic() { + // This method will be called once per scheduler run } } From a38025043b4ae9730e2a110f7ad71f67939fb706 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Mon, 14 Nov 2022 19:53:50 -0500 Subject: [PATCH 08/14] Base pilotable --- src/main/java/frc/robot/Constants.java | 13 +++++-------- .../java/frc/robot/subsystems/BasePilotable.java | 3 ++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 9948f92..048e266 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -14,17 +14,14 @@ package frc.robot; *

It is advised to statically import this class (or one of its inner classes) wherever the * constants are needed, to reduce verbosity. */ -<<<<<<< HEAD -public final class Constants {} -private static final int MoteurAvantGauche = (0); -private static final int MoteurAvantDroit = (0); -private static final int MoteurArriereGauche = (0); -private static final int MoteurArriereDroit = (0); -======= public final class Constants { + public static final int MoteurAvantGauche = 0; + public static final int MoteurAvantDroit = 1; + public static final int MoteurArriereGauche = 2; + public static final int MoteurArriereDroit = 3; + public static final int PistonPousserR = 0; public static final int PistonPousserF = 1; public static final int pistonQuiShakef = 0; public static final int pistonQuiShakeb = 1; } ->>>>>>> 8da918a7d2ab52ff5442835f9f446fc07fe2d1bd diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index eaaa4bd..739b312 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -8,6 +8,7 @@ import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; import edu.wpi.first.wpilibj.drive.MecanumDrive; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.Constants; public class BasePilotable extends SubsystemBase { @@ -23,7 +24,7 @@ private WPI_TalonSRX arriereDroit = new WPI_TalonSRX(Constants.MoteurArriereDroi private MecanumDrive mecanum = new MecanumDrive(avantGauche, arriereGauche, avantDroit, arriereDroit); private void Drive(double y, double x, double rot){ - drive.driveCarthesian(y, x, rot, 0); + mecanum.driveCartesian(y, x, rot, 0); } /** Creates a new BasePilotable. */ public BasePilotable() {} From bd28fe35c838235927074c4ba87a2f08243e9cfe Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Mon, 14 Nov 2022 19:56:37 -0500 Subject: [PATCH 09/14] base pilotable --- src/main/java/frc/robot/subsystems/BasePilotable.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index 739b312..156cc09 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -23,12 +23,15 @@ private WPI_TalonSRX arriereDroit = new WPI_TalonSRX(Constants.MoteurArriereDroi private MecanumDrive mecanum = new MecanumDrive(avantGauche, arriereGauche, avantDroit, arriereDroit); -private void Drive(double y, double x, double rot){ +private void drive(double y, double x, double rot){ mecanum.driveCartesian(y, x, rot, 0); } /** Creates a new BasePilotable. */ - public BasePilotable() {} - + public BasePilotable() { + avantDroit.setInverted(true); + arriereDroit.setInverted(true); + } + @Override public void periodic() { // This method will be called once per scheduler run From d3d21a76baa226a67a7b793f03eaba07123ce485 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Mon, 14 Nov 2022 20:01:34 -0500 Subject: [PATCH 10/14] asd --- .../java/frc/robot/commands/Activer_poussoir.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/commands/Activer_poussoir.java b/src/main/java/frc/robot/commands/Activer_poussoir.java index f40f96f..1ac4a06 100644 --- a/src/main/java/frc/robot/commands/Activer_poussoir.java +++ b/src/main/java/frc/robot/commands/Activer_poussoir.java @@ -5,12 +5,17 @@ package frc.robot.commands; import edu.wpi.first.wpilibj2.command.CommandBase; +import frc.robot.subsystems.Poussoir; public class Activer_poussoir extends CommandBase { - /** Creates a new Activer_poussoir. */ - public Activer_poussoir() { - // Use addRequirements() here to declare subsystem dependencies. - } + private Poussoir poussoir; + + public Activer_poussoir(Poussoir poussoir) { + this.poussoir = poussoir; + + + addRequirements(poussoir); + } // Called when the command is initially scheduled. @Override From 6bab4695610680425aa2e1f3d0044cf2cabc1dc9 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 16 Nov 2022 17:55:52 -0500 Subject: [PATCH 11/14] regler probleme --- src/main/java/frc/robot/Constants.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 048e266..ea38a81 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -15,10 +15,10 @@ package frc.robot; * constants are needed, to reduce verbosity. */ public final class Constants { - public static final int MoteurAvantGauche = 0; - public static final int MoteurAvantDroit = 1; - public static final int MoteurArriereGauche = 2; - public static final int MoteurArriereDroit = 3; + public static final int MoteurAvantGauche = (0); + public static final int MoteurAvantDroit = (0); + public static final int MoteurArriereGauche = (0); + public static final int MoteurArriereDroit = (0); public static final int PistonPousserR = 0; public static final int PistonPousserF = 1; From 58cf46973f713dcd8568917aa552ed64f3102713 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 16 Nov 2022 17:58:31 -0500 Subject: [PATCH 12/14] a --- src/main/java/frc/robot/commands/Activer_poussoir.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/frc/robot/commands/Activer_poussoir.java b/src/main/java/frc/robot/commands/Activer_poussoir.java index 1ac4a06..ae6fef0 100644 --- a/src/main/java/frc/robot/commands/Activer_poussoir.java +++ b/src/main/java/frc/robot/commands/Activer_poussoir.java @@ -21,10 +21,6 @@ public class Activer_poussoir extends CommandBase { @Override public void initialize() {} - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() {} - // Called once the command ends or is interrupted. @Override public void end(boolean interrupted) {} From ea2d2aa2affbdcfb2de95961e61b288036573422 Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Wed, 16 Nov 2022 18:00:19 -0500 Subject: [PATCH 13/14] ajout du piston bloqueur --- src/main/java/frc/robot/Constants.java | 2 ++ src/main/java/frc/robot/subsystems/Poussoir.java | 1 + 2 files changed, 3 insertions(+) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 0b24b86..8b348ff 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -19,4 +19,6 @@ public final class Constants { public static final int PistonPousserF = 1; public static final int pistonQuiShakef = 0; public static final int pistonQuiShakeb = 1; + public static final int pistonBloqueurR = 2; + public static final int pistonBloqueurF = 3; } diff --git a/src/main/java/frc/robot/subsystems/Poussoir.java b/src/main/java/frc/robot/subsystems/Poussoir.java index 7774e23..f0b0056 100644 --- a/src/main/java/frc/robot/subsystems/Poussoir.java +++ b/src/main/java/frc/robot/subsystems/Poussoir.java @@ -11,6 +11,7 @@ import frc.robot.Constants; public class Poussoir extends SubsystemBase { private DoubleSolenoid pousser = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.PistonPousserR,Constants.PistonPousserF ); + private DoubleSolenoid bloqueur = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.pistonBloqueurR,Constants.pistonBloqueurF); /** Creates a new Poussoir. */ public Poussoir() { From bcd4997de02589a843bffc042659dfebb3765f8d Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Mon, 21 Nov 2022 17:47:39 -0500 Subject: [PATCH 14/14] k --- src/main/java/frc/robot/commands/Activer_poussoir.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/frc/robot/commands/Activer_poussoir.java b/src/main/java/frc/robot/commands/Activer_poussoir.java index ae6fef0..b63df40 100644 --- a/src/main/java/frc/robot/commands/Activer_poussoir.java +++ b/src/main/java/frc/robot/commands/Activer_poussoir.java @@ -32,4 +32,3 @@ public class Activer_poussoir extends CommandBase { } } -