From b237e6d40e645b17ba6e2f6c8dc592f542ec61bd Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 8 Feb 2023 18:20:19 -0500 Subject: [PATCH 1/8] gfhjk --- .../java/frc/robot/subsystems/BasePilotable.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index 5a2e212..21dedaf 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -22,6 +22,22 @@ public class BasePilotable extends SubsystemBase { final DifferentialDrive drive = new DifferentialDrive(gauche, droit); + public void drive(double xSpeed, double zRotation){ + drive.arcadeDrive(xSpeed, zRotation); + } + public double distance(){ + return (-avantdroit.getEncoder().getPosition() + +avantgauche.getEncoder().getPosition() + -arrieredroit.getEncoder().getPosition() + +arrieregauche.getEncoder().getPosition()) / 4; + } + public void Reset() { + avantdroit.getEncoder().setPosition(0); + avantgauche.getEncoder().setPosition(0); + arrieredroit.getEncoder().setPosition(0); + arrieregauche.getEncoder().setPosition(0); + } + /** Creates a new BasePilotable. */ public BasePilotable() { droit.setInverted(true); From 3ee0a46bfa2dff46f61634b2b9c1ddcbe608bf9e Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 8 Feb 2023 18:28:25 -0500 Subject: [PATCH 2/8] sdf --- src/main/java/frc/robot/commands/Drive.java | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/frc/robot/commands/Drive.java diff --git a/src/main/java/frc/robot/commands/Drive.java b/src/main/java/frc/robot/commands/Drive.java new file mode 100644 index 0000000..4288b6a --- /dev/null +++ b/src/main/java/frc/robot/commands/Drive.java @@ -0,0 +1,32 @@ +// 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 Drive extends CommandBase { + /** Creates a new Drive. */ + public Drive() { + // 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 7c927477d131f4504552f03f9acb183f429e3607 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 8 Feb 2023 18:29:43 -0500 Subject: [PATCH 3/8] xvcbnm, --- src/main/java/frc/robot/commands/Drive.java | 32 --------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/main/java/frc/robot/commands/Drive.java diff --git a/src/main/java/frc/robot/commands/Drive.java b/src/main/java/frc/robot/commands/Drive.java deleted file mode 100644 index 4288b6a..0000000 --- a/src/main/java/frc/robot/commands/Drive.java +++ /dev/null @@ -1,32 +0,0 @@ -// 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 Drive extends CommandBase { - /** Creates a new Drive. */ - public Drive() { - // 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 6d7ee56942736f1410c90b58a0184b0634656738 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 8 Feb 2023 18:53:26 -0500 Subject: [PATCH 4/8] zdxfgvcbnm, --- .../java/frc/robot/subsystems/bras/Pivot.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/bras/Pivot.java b/src/main/java/frc/robot/subsystems/bras/Pivot.java index 2742df8..ec2f376 100644 --- a/src/main/java/frc/robot/subsystems/bras/Pivot.java +++ b/src/main/java/frc/robot/subsystems/bras/Pivot.java @@ -5,11 +5,25 @@ package frc.robot.subsystems.bras; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import com.revrobotics.CANSparkMax; +import com.revrobotics.CANSparkMaxLowLevel.MotorType; +import static frc.robot.Constants.*; public class Pivot extends SubsystemBase { - /** Creates a new Pivot. */ - public Pivot() {} + // moteur + private CANSparkMax pivot = new CANSparkMax(actuateur, MotorType.kBrushless); + // function + public void monteDescendredroit(double vitesse) { + pivot.set (vitesse); + } + // encoder + public double distance(){ + return (pivot.getEncoder().getPosition()); + } + public void Reset(){ + pivot.getEncoder().setPosition(0); + } @Override public void periodic() { // This method will be called once per scheduler run From bca78522e582144201aa28aaf1184dc372c059be Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 8 Feb 2023 18:54:01 -0500 Subject: [PATCH 5/8] j --- src/main/java/frc/robot/Constants.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index fe07cb5..cc28426 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -5,9 +5,5 @@ public class Constants { public static int avantgauche = 1; public static int arrieredroit = 2; public static int arrieregauche = 3; - - - - - + public static int actuateur = 4; } From e49e8683e6b132448db358f1bcbb77ebba2ef88d Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 8 Feb 2023 18:58:29 -0500 Subject: [PATCH 6/8] vh --- src/main/java/frc/robot/subsystems/Gratte.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/main/java/frc/robot/subsystems/Gratte.java diff --git a/src/main/java/frc/robot/subsystems/Gratte.java b/src/main/java/frc/robot/subsystems/Gratte.java new file mode 100644 index 0000000..5baa6b8 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/Gratte.java @@ -0,0 +1,17 @@ +// 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.wpilibj2.command.SubsystemBase; + +public class Gratte extends SubsystemBase { + /** Creates a new Gratte. */ + public Gratte() {} + + @Override + public void periodic() { + // This method will be called once per scheduler run + } +} From 91d5a71d52bad9fc56b40c68d78207113e16cd21 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 8 Feb 2023 18:59:45 -0500 Subject: [PATCH 7/8] j --- src/main/java/frc/robot/subsystems/bras/Pivot.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/bras/Pivot.java b/src/main/java/frc/robot/subsystems/bras/Pivot.java index ec2f376..e8d5dbb 100644 --- a/src/main/java/frc/robot/subsystems/bras/Pivot.java +++ b/src/main/java/frc/robot/subsystems/bras/Pivot.java @@ -14,7 +14,7 @@ public class Pivot extends SubsystemBase { private CANSparkMax pivot = new CANSparkMax(actuateur, MotorType.kBrushless); // function - public void monteDescendredroit(double vitesse) { + public void monteDescendre(double vitesse) { pivot.set (vitesse); } // encoder From f9c6011a3c9d3681360db49ee770d647bababada Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 8 Feb 2023 19:13:50 -0500 Subject: [PATCH 8/8] mghvhj --- src/main/java/frc/robot/Constants.java | 2 ++ .../robot/subsystems/bras/BrasTelescopique.java | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index fe07cb5..4a5c923 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -5,6 +5,8 @@ public class Constants { public static int avantgauche = 1; public static int arrieredroit = 2; public static int arrieregauche = 3; + public static int BrasTelescopique = 5; + diff --git a/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java b/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java index 140625f..f4f1458 100644 --- a/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java +++ b/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java @@ -4,11 +4,26 @@ package frc.robot.subsystems.bras; + +import com.revrobotics.CANSparkMax; +import com.revrobotics.CANSparkMaxLowLevel.MotorType; + import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.Constants; public class BrasTelescopique extends SubsystemBase { /** Creates a new BrasTelescopique. */ public BrasTelescopique() {} + final CANSparkMax Winch = new CANSparkMax(Constants.BrasTelescopique,MotorType.kBrushless); + public void AvanceRecule(double vitesse) { + Winch.set(vitesse); + } + public double distance() { + return(Winch.getEncoder().getPosition()); + } + public void Reset() { + Winch.getEncoder().setPosition(0); + } @Override public void periodic() {