From 4708c8526b91ee8f2b3c5803cc0178e65ce3c878 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Mon, 14 Nov 2022 19:15:41 -0500 Subject: [PATCH 1/7] 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 de18ce196167b2f81f0ebc0c659f691271c33ecf Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Mon, 14 Nov 2022 19:46:09 -0500 Subject: [PATCH 2/7] 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 3/7] 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 4/7] 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 5/7] 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 6/7] 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 7/7] 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) {}