From b749483330e7a5d2922eec6dc85e041edc590779 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Mon, 20 Feb 2023 18:41:25 -0500 Subject: [PATCH 1/5] trewertytrertytrewertrewertrewertewertertrertrewertyuytrertrerererewewerewerewerttrrtrertrertrerewertrerererytrewertyuytrewqwertyuytrewq523454321234523455675434rtytrewertyuytrewertyuiuytrewq --- src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java | 3 ++- src/main/java/frc/robot/subsystems/bras/Pince.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java b/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java index f4f1458..3f38ebc 100644 --- a/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java +++ b/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java @@ -8,6 +8,7 @@ package frc.robot.subsystems.bras; import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkMaxLowLevel.MotorType; +import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; @@ -27,6 +28,6 @@ public class BrasTelescopique extends SubsystemBase { @Override public void periodic() { - // This method will be called once per scheduler run + Shuffleboard.getTab("SmartDashBoard") .add("winch",0.1); } } diff --git a/src/main/java/frc/robot/subsystems/bras/Pince.java b/src/main/java/frc/robot/subsystems/bras/Pince.java index a933219..2aa6540 100644 --- a/src/main/java/frc/robot/subsystems/bras/Pince.java +++ b/src/main/java/frc/robot/subsystems/bras/Pince.java @@ -15,8 +15,8 @@ public class Pince extends SubsystemBase { /** Creates a new Pince. */ public Pince() { } -public void fermer() { - pistonPince.set(Value.kReverse); + public void fermer() { + pistonPince.set(Value.kReverse); } public void ouvrir() { pistonPince.set(Value.kForward); From fb8978e66c214a94c9d4e71df8cab3664aff9fe5 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Mon, 20 Feb 2023 18:42:34 -0500 Subject: [PATCH 2/5] mh --- networktables.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 networktables.json diff --git a/networktables.json b/networktables.json new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/networktables.json @@ -0,0 +1 @@ + From d4a47ec15798b8975731ed3415c1e9dc7cf787e6 Mon Sep 17 00:00:00 2001 From: OlivierDubois Date: Mon, 20 Feb 2023 19:57:40 -0500 Subject: [PATCH 3/5] yrfjchn --- src/main/java/frc/robot/subsystems/BasePilotable.java | 11 +++++++++-- src/main/java/frc/robot/subsystems/bras/Pivot.java | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index 220799e..4243b3c 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -13,6 +13,8 @@ import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj.drive.DifferentialDrive; import edu.wpi.first.wpilibj.motorcontrol.MotorControllerGroup; +import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; +import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; @@ -24,10 +26,12 @@ public class BasePilotable extends SubsystemBase { final MotorControllerGroup droit = new MotorControllerGroup(avantdroit, arrieredroit); final MotorControllerGroup gauche = new MotorControllerGroup(avantgauche, arrieregauche); final DifferentialDrive drive = new DifferentialDrive(gauche, droit); + //piston private DoubleSolenoid brakedroit = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakedroit, Constants.brakedroit); private DoubleSolenoid brakegauche = new DoubleSolenoid(PneumaticsModuleType.CTREPCM,Constants.brakegauche, Constants.brakegauche); //gyro + ShuffleboardTab teb = Shuffleboard.getTab("teb"); private AHRS gyroscope = new AHRS();public double getangle() {return gyroscope.getAngle();} public double getpitch() { return gyroscope.getPitch(); @@ -63,7 +67,10 @@ public void BrakeFerme(){ @Override public void periodic() { - // This method will be called once per scheduler run - + teb .add("encodeuravantdroit",0.1); + teb .add("encodeurarrieregauche",0.1); + teb .add("encodeurarrieredroit",0.1); + teb .add("encodeuravantgauche",0.1); + teb .add("distance",0.1); } } diff --git a/src/main/java/frc/robot/subsystems/bras/Pivot.java b/src/main/java/frc/robot/subsystems/bras/Pivot.java index e8d5dbb..d9166ec 100644 --- a/src/main/java/frc/robot/subsystems/bras/Pivot.java +++ b/src/main/java/frc/robot/subsystems/bras/Pivot.java @@ -4,6 +4,7 @@ package frc.robot.subsystems.bras; +import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkMaxLowLevel.MotorType; @@ -26,6 +27,6 @@ public class Pivot extends SubsystemBase { } @Override public void periodic() { - // This method will be called once per scheduler run - } + Shuffleboard.getTab("SmartDashBoard") .add("pivot encodeur",0.1); + } } From 50d481c2b6252ae156f75df5a42a815e5c57ba38 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Mon, 20 Feb 2023 20:00:18 -0500 Subject: [PATCH 4/5] dgnxfbv n --- .../robot/commands/bras/PivotChercheBas.java | 59 +++++++++++++++++++ .../robot/commands/bras/PivotChercheHaut.java | 59 +++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 src/main/java/frc/robot/commands/bras/PivotChercheBas.java create mode 100644 src/main/java/frc/robot/commands/bras/PivotChercheHaut.java diff --git a/src/main/java/frc/robot/commands/bras/PivotChercheBas.java b/src/main/java/frc/robot/commands/bras/PivotChercheBas.java new file mode 100644 index 0000000..33cc965 --- /dev/null +++ b/src/main/java/frc/robot/commands/bras/PivotChercheBas.java @@ -0,0 +1,59 @@ +// 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.bras; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc.robot.subsystems.bras.BrasTelescopique; +import frc.robot.subsystems.bras.Pivot; + +public class PivotChercheBas extends CommandBase { + private BrasTelescopique brasTelescopique; + private Pivot pivot; + /** Creates a new PivotChercheBas. */ + public PivotChercheBas(BrasTelescopique brasTelescopique, Pivot pivot) { + this.brasTelescopique = brasTelescopique; + this.pivot = pivot; + // Use addRequirements() here to declare subsystem dependencies. + addRequirements(brasTelescopique); + addRequirements(pivot); + } + + // 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() { + if(brasTelescopique.distance()<10){ + brasTelescopique.AvanceRecule(0.5); + } + else if(brasTelescopique.distance()>11) { + brasTelescopique.AvanceRecule(-0.5); + } + else { + brasTelescopique.AvanceRecule(0); + } + if (pivot.distance()<10){ + pivot.monteDescendre(0.5); + } + else if(pivot.distance()>11) { + pivot.monteDescendre(-0.5); + } + else{ + pivot.monteDescendre(0); + } + } + + // 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; + } +} \ No newline at end of file diff --git a/src/main/java/frc/robot/commands/bras/PivotChercheHaut.java b/src/main/java/frc/robot/commands/bras/PivotChercheHaut.java new file mode 100644 index 0000000..4288827 --- /dev/null +++ b/src/main/java/frc/robot/commands/bras/PivotChercheHaut.java @@ -0,0 +1,59 @@ +// 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.bras; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc.robot.subsystems.bras.BrasTelescopique; +import frc.robot.subsystems.bras.Pivot; + +public class PivotChercheHaut extends CommandBase { + private BrasTelescopique brasTelescopique; + private Pivot pivot; + /** Creates a new PivotChercheHaut. */ + public PivotChercheHaut(BrasTelescopique brasTelescopique, Pivot pivot) { + this.brasTelescopique = brasTelescopique; + this.pivot = pivot; + // Use addRequirements() here to declare subsystem dependencies. + addRequirements(brasTelescopique); + addRequirements(pivot); + } + + // 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() { + if(brasTelescopique.distance()<10){ + brasTelescopique.AvanceRecule(0.5); + } + else if(brasTelescopique.distance()>11) { + brasTelescopique.AvanceRecule(-0.5); + } + else { + brasTelescopique.AvanceRecule(0); + } + if (pivot.distance()<10){ + pivot.monteDescendre(0.5); + } + else if(pivot.distance()>11) { + pivot.monteDescendre(-0.5); + } + else{ + pivot.monteDescendre(0); + } + } + + // 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 02c52c24bf864d23d3976380a624ef5ff8bfa8d6 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Mon, 20 Feb 2023 20:04:43 -0500 Subject: [PATCH 5/5] tdyjhgmvj --- .../java/frc/robot/subsystems/bras/BrasTelescopique.java | 6 ------ src/main/java/frc/robot/subsystems/bras/Pivot.java | 8 +------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java b/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java index 08f983b..e015295 100644 --- a/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java +++ b/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java @@ -8,10 +8,7 @@ package frc.robot.subsystems.bras; import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkMaxLowLevel.MotorType; -<<<<<<< HEAD import edu.wpi.first.wpilibj.DigitalInput; -======= ->>>>>>> Dash import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; @@ -35,10 +32,7 @@ public class BrasTelescopique extends SubsystemBase { } @Override public void periodic() { -<<<<<<< HEAD Shuffleboard.getTab("SmartDashBoard") .add("photocell",0.1); -======= Shuffleboard.getTab("SmartDashBoard") .add("winch",0.1); ->>>>>>> Dash } } diff --git a/src/main/java/frc/robot/subsystems/bras/Pivot.java b/src/main/java/frc/robot/subsystems/bras/Pivot.java index b2494d0..421aa5c 100644 --- a/src/main/java/frc/robot/subsystems/bras/Pivot.java +++ b/src/main/java/frc/robot/subsystems/bras/Pivot.java @@ -4,10 +4,7 @@ package frc.robot.subsystems.bras; -<<<<<<< HEAD import edu.wpi.first.wpilibj.DigitalInput; -======= ->>>>>>> Dash import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; @@ -37,11 +34,8 @@ public class Pivot extends SubsystemBase { } @Override public void periodic() { -<<<<<<< HEAD Shuffleboard.getTab("SmartDashBoard") .add("limitpivot",0.1); } -======= Shuffleboard.getTab("SmartDashBoard") .add("pivot encodeur",0.1); } ->>>>>>> Dash -} +