From bf67f5db8036aadc185a3b7e7da44f89a59bce54 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Mon, 13 Feb 2023 19:44:54 -0500 Subject: [PATCH 01/24] srdtfgh --- .../frc/robot/subsystems/BasePilotable.class | Bin 3529 -> 1904 bytes .../frc/robot/subsystems/BasePilotable.java | 1 - .../java/frc/robot/subsystems/Gratte.java | 9 --------- 3 files changed, 10 deletions(-) diff --git a/bin/main/frc/robot/subsystems/BasePilotable.class b/bin/main/frc/robot/subsystems/BasePilotable.class index a1ecf8d0e5dc7b0fe12ec67cf110faf2ead1688a..ebf1b7601d549ee330a2682cd4f886bcb8240690 100644 GIT binary patch literal 1904 zcmeHHZBNud5S~R|?#dyEBEA9TMLZO56Jj)qF#;!Qa-iXm#E;u{?{1;(HoMyjKg^hD zqTl^d#%Zq?G3jCMyI(pxJ3G%jGxMZBe|`N908fC9!4QF^mU5|*jxO)imax!xN(w_@u7R(p z;z?FVxSH;4?KdN)PWIU8CV}znaht_%2U9CdDZv%blP7Yw7aqy)pEe2^(LfrhTp1cA zeY%%AJ6*@;>a~(_gat>>fr$ib(mr6G!Z59iRtpJ*Mlipg-XMhKD0b50xY{SZE@PZu zQ~ErV!b>~NvU=6a?K35{DdOn(k)n%|R10OKomg*!J=1rRrLp z!0?Xra5XmwOdjL>sE<+lN-3#IaErj=hfr}X{e*iqP9N9BjF6!n;SPKrJhLqeX5mf+ z=3pKN@?3<%ydW@BZTvxN8YRN^=Gqa~Xo!&S$AQDuVX6rN(+%k||A;A(`uXLs=?G0= zrSWf7{1J-sr@ON>dFw}K+xe9m*9uV^R z;%+szTR!Y?TLh6*#zuCvOp7(tMq18j+ht)WjqPx|H#e(%QPeilW_FVI|Nm`Q2LsIk zw;gdMq$gZlX;a3^<+~yi*Iz%NS}I9c1e5~)xh$B15g5hO6pZDzl-qJ{Ef~+@mE2Ci zW%P$&5_3{}CAZUX75y?IUxOL^UPtc{Rv~DuZ!r6D`sNq7{Ugg+!0%`lnFkxsmF_F# zwS*plf%sX~PHJ_tp6cv*<>5N9_8wcn2ly(<6! literal 3529 zcmbVO=~vWN6#oT~afYZ=#ofB&fJ>?(idc)z0CGAg1;nCV%wz%tLNZMarZ{%m z_7pdlb}zV|KJF^VR9EjYOxsh_rXE3+gq?aOr%YxIWyo+`PpnKMJ-S!X?D28c$|!w# zVIe9ZrcS7qmvL;vldwL;Q;MTc_;w75(#Sd$yz5mgm@}(k(WLU}Ne|r(@@`G*~@HnK40|N*QGtho6J_#$%VtZr&_}%k5RPy~z|P0i?j zg(NJX_J#pkIp3Gn^^63GNsC_WC8j;YwzxO=>!M#7!)0nUKbZ$)EI@S(EohD4P?*dz z$dz#zPZ9~NOuMDA8jgf5@rJv=-m9B5IiZJ#T5IqWjz-WXVZ;2sn0HjhF;T7>TIjJ| zL-;MSm6Q=dwODn?SQxC1%ZQ@7x~-PI&3}x)S9f(bAJH-(ES`{Y5PCVZ^J zb|zJaHQD(#&8zTNAMhB_#ifAynq)Ozn=vq{xFsTP^vN>Lv20*9lA5l1e`)f zh8~2`t54{Tn0D2N4a@M3#88P58AC`#F$yz+F$v3x4Z}GkfabXZV@*+5$VOlj?DJ7D zXF8_r$rP=aTm4Dae<8~xz61g-Hg?R(xg)0TvMrUnFn3QC%w!8Z;b>06zIfL|N{j4_ zVp4#RQH$IQC|#oaPUi?-ld$*Ug=4scH$+HpN-)b6`(D;t&z3>R zJ%s|Kyd@)s8qtt%%aBnc2HCs9nfD}&J(4qz>dObX8o`HUyRyg9bK@LFn%iw>a-8ly zpgzJi36Vs9Z+lOoyL?lY5^fa$_(Y6^CefasiJ(81u%}$mC3ST9x4 zn48Z0Mq7?9yBJhGodM!}Ml@hG=^8ZBxj4hwfqkS+qz6cgS!*c-{WMZx&@Nq_>(Jtx z=&r=+(4*o`xK!K;pTb=+M=KaB_%K-v1?!lPM&{ulvr)={X9^Bn%O-%HDVy1bH(z-%a>2gZ7f>N=Xuk;|5wovJzl1h2E1*wv@ap;Rw-EN%4 zaN}QS8JvPKh4ERq(`XJE6M04=WSq}4+C#?0JfoA0OM?uyx$1AcI#|h7d*3WxpT_0< zmqg)9XYl0;zw8h)SNOX;i+83GC+jR-d4CEY^ZzV9oknkwcYO-iecn0p)(p<#%W13> z!c{Z)s+fvq;s|`+RrwuRM78Hg(GuPcDqoA w@A4@l0!5GVS2Pqfb8?QL6be@0dmgR85BQOEDOVPL!Y^&B`2;zO8*Quq2V@CzF8}}l diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index 220799e..9b1eb24 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -7,7 +7,6 @@ package frc.robot.subsystems; import com.kauailabs.navx.frc.AHRS; import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkMaxLowLevel.MotorType; - import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj.DoubleSolenoid.Value; diff --git a/src/main/java/frc/robot/subsystems/Gratte.java b/src/main/java/frc/robot/subsystems/Gratte.java index e7e1cb6..9bc4bb1 100644 --- a/src/main/java/frc/robot/subsystems/Gratte.java +++ b/src/main/java/frc/robot/subsystems/Gratte.java @@ -5,19 +5,10 @@ package frc.robot.subsystems; import edu.wpi.first.wpilibj2.command.SubsystemBase; - - - import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX; - - import edu.wpi.first.wpilibj.DigitalInput; - - import frc.robot.Constants; - - public class Gratte extends SubsystemBase { private WPI_TalonSRX Gratted = new WPI_TalonSRX(Constants.leverGratte); private WPI_TalonSRX Gratteg = new WPI_TalonSRX(Constants.baisserGratte); From c7aca5961d047a5751682ae65f2831c114b5576b Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Mon, 13 Feb 2023 19:48:32 -0500 Subject: [PATCH 02/24] sfk --- .../frc/robot/subsystems/BasePilotable.class | Bin 1904 -> 3529 bytes src/main/java/frc/robot/Constants.java | 8 +++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/main/frc/robot/subsystems/BasePilotable.class b/bin/main/frc/robot/subsystems/BasePilotable.class index ebf1b7601d549ee330a2682cd4f886bcb8240690..a2332e150d55ae79549ace7f41302a982571b46e 100644 GIT binary patch literal 3529 zcmbVO=~vWN6#oT~afYZ=Ma8{}I^Yr&6e-%O!y>1HQa~)y#Y`qZASBZy18VJR?QZR6 z_uYQ)DW|}(J?)2n)c>iczn5fY5NF&tOzwL(@9w{QUvB;P=RW|N@oNNS61EIGn&Q|g z+f&?Z%Dv!v`h=?-S6#iwFl|pwnR)~j5_ak7tTL4`lwrehJ+U&4)YyJSvnM80E3Ne9 zgoUVtm^!IiUfQt@Pr`;IPbrQ*>Dw_hS4kW@*_TnB@ox2etAr~5@Q9k#Mky+*j$`PK z9ttlBx4GAgLVioKs7K0#?b(iITb^T^O1Ib~f{m#=osON&&|u{}WyU0JDkYSq9lloD zjNxHAWO;^awh0bZ#8Qqrp7U{g3Gp^N%l!4(rf%6rT14tg<*Y|XE;zQU*%^8eP2QF8H!?y1&@$)n}*`Zfs_2|KMvAz_V-PX%nEPRa3$0w?+=&I*^J?7 zqr$5?8QZWuFxn%Segqw?LcFc5tA0SlP%mQ%md3CXyCc{oVR!M`mMDjeJx~OU98FE@ zeuX3~qW1a$S~=gB(e<?Ni>!?w6L`0JuyX~Sh|H9winG8UmSh8DC&@I;u* z63CTt7)OW%R;Jz3SPe(Q)_DD0VDHsUnw-?bL# zMI3G)NE)ej$FUt2Gj?1c{Zw|+@iWvXV;QQWIE^zAFux7OOLZso>jqRatIK#6gG~5% zhwV(M4r{XOff^@}ZjE6G&qweaVfY|6WxRkF8NZ(eCH^p$0#K?l9z%650Uf$C!33N} zT818k(W_7Dj+l0phYic{o{XU!qcVn(jA9IC1mhA`6dHzeNC3@q1;(19u#kzsCfFCE zVBU00+EYndG3)$E)_);SCYen-a`Y#lDyI)}ayz zxu;Nol(%HWP$e4jZ5cAE#2|ZDIP;!_@keszQGNLUS0nhaWLNfBdUk@tNOQaGbe7ZI z2h>NnCLxmO?``i%beC?*V#2Kg0H27F&?MUPGZFOX684n}x~PsW{}vd-7oy>)XDxVf zT*B8fzQMP_#OkuxYMvP574frTtS`>!j$x+_jjhmUXB|!NF#Ox=j!&08WBjz>Cqw$64fZ4%ir~#ZAFgwHU@e zyBudij|w~CQeh{23U`GZtzxXeZkBux)QBPvg4JJ4fEy!8v?6gVjQ~ zVisQ&QgM(t0$K^r6$I-_BB_SxS%ni=jTF{!IMw1B*5L+AJI9vzm!E>SaAaP}Zs+Up wT`pz36hx2mS1=Sbb7G#L6bhE%dmb&r5BQOEIad~b!Y@Z_`3W+F8%JyZ2Obe~2><{9 literal 1904 zcmeHHZBNud5S~R|?#dyEBEA9TMLZO56Jj)qF#;!Qa-iXm#E;u{?{1;(HoMyjKg^hD zqTl^d#%Zq?G3jCMyI(pxJ3G%jGxMZBe|`N908fC9!4QF^mU5|*jxO)imax!xN(w_@u7R(p z;z?FVxSH;4?KdN)PWIU8CV}znaht_%2U9CdDZv%blP7Yw7aqy)pEe2^(LfrhTp1cA zeY%%AJ6*@;>a~(_gat>>fr$ib(mr6G!Z59iRtpJ*Mlipg-XMhKD0b50xY{SZE@PZu zQ~ErV!b>~NvU=6a?K35{DdOn(k)n%|R10OKomg*!J=1rRrLp z!0?Xra5XmwOdjL>sE<+lN-3#IaErj=hfr}X{e*iqP9N9BjF6!n;SPKrJhLqeX5mf+ z=3pKN@?3<%ydW@BZTvxN8YRN^=Gqa~Xo!&S$AQDuVX6rN(+%k||A;A(`uXLs=?G0= zrSWf7{1J-sr@ON>dFw}K+xe9m*9uV^R z;%+szTR!Y?TLh6*#zuCvOp7(tMq18j+ht)WjqPx|H#e(%QPeilW_FVI|Nm`Q2LsIk zw;gdMq$gZlX;a3^<+~yi*Iz%NS}I9c1e5~)xh$B15g5hO6pZDzl-qJ{Ef~+@mE2Ci zW%P$&5_3{}CAZUX75y?IUxOL^UPtc{Rv~DuZ!r6D`sNq7{Ugg+!0%`lnFkxsmF_F# zwS*plf%sX~PHJ_tp6cv*<>5N9_8wcn2ly(<6! diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 427cfff..450a43b 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -5,7 +5,9 @@ public class Constants { public static int avantgauche = 1; public static int arrieredroit = 2; public static int arrieregauche = 3; - + public static int BrasTelescopique = 4; + + //moteur gris public static int leverGratte = 0; public static int baisserGratte = 1; @@ -15,12 +17,12 @@ public class Constants { public static int actuateur = 2; public static int brakedroit = 3; public static int brakegauche = 4; - // DIO + // DIO Brando public static int limitbd = 0; public static int limitbg = 2; public static int limithd = 3; public static int limithg = 1; - public static int BrasTelescopique = 5; + } \ No newline at end of file From 77b894194e825b545c99e0f4f77758c28add4674 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Mon, 13 Feb 2023 19:51:56 -0500 Subject: [PATCH 03/24] gjnvb --- .../robot/commands/bras/PivoteBrasBas.java | 35 +++++++++++++++++-- .../robot/commands/bras/PivoteBrasHaut.java | 31 ++++++++++++++-- .../commands/bras/PivoteBrasMilieux.java | 32 +++++++++++++++-- 3 files changed, 92 insertions(+), 6 deletions(-) diff --git a/src/main/java/frc/robot/commands/bras/PivoteBrasBas.java b/src/main/java/frc/robot/commands/bras/PivoteBrasBas.java index 03a1793..de9ddfb 100644 --- a/src/main/java/frc/robot/commands/bras/PivoteBrasBas.java +++ b/src/main/java/frc/robot/commands/bras/PivoteBrasBas.java @@ -4,12 +4,22 @@ 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 PivoteBrasBas extends CommandBase { + private BrasTelescopique brasTelescopique; + private Pivot pivot; /** Creates a new PivoteBrasBas. */ - public PivoteBrasBas() { + public PivoteBrasBas(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. @@ -18,7 +28,28 @@ public class PivoteBrasBas extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override - public void execute() {} + 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 diff --git a/src/main/java/frc/robot/commands/bras/PivoteBrasHaut.java b/src/main/java/frc/robot/commands/bras/PivoteBrasHaut.java index 4932ad2..2ba3c74 100644 --- a/src/main/java/frc/robot/commands/bras/PivoteBrasHaut.java +++ b/src/main/java/frc/robot/commands/bras/PivoteBrasHaut.java @@ -5,11 +5,19 @@ 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 PivoteBrasHaut extends CommandBase { + private BrasTelescopique brasTelescopique; + private Pivot pivot; /** Creates a new PivoteBrasHaut. */ - public PivoteBrasHaut() { + public PivoteBrasHaut(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. @@ -18,7 +26,26 @@ public class PivoteBrasHaut extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override - public void execute() {} + 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 diff --git a/src/main/java/frc/robot/commands/bras/PivoteBrasMilieux.java b/src/main/java/frc/robot/commands/bras/PivoteBrasMilieux.java index be7e44e..da8939b 100644 --- a/src/main/java/frc/robot/commands/bras/PivoteBrasMilieux.java +++ b/src/main/java/frc/robot/commands/bras/PivoteBrasMilieux.java @@ -5,11 +5,19 @@ 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 PivoteBrasMilieux extends CommandBase { + private BrasTelescopique brasTelescopique; + private Pivot pivot; /** Creates a new PivoteBrasMilieux. */ - public PivoteBrasMilieux() { + public PivoteBrasMilieux(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. @@ -18,7 +26,27 @@ public class PivoteBrasMilieux extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override - public void execute() {} + 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 From a45a443bd3a6f7e1357cd2cba46949d903bb7f9d Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Mon, 13 Feb 2023 19:52:13 -0500 Subject: [PATCH 04/24] sfdhj --- .../frc/robot/commands/StablePlateform.java | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/main/java/frc/robot/commands/StablePlateform.java diff --git a/src/main/java/frc/robot/commands/StablePlateform.java b/src/main/java/frc/robot/commands/StablePlateform.java deleted file mode 100644 index f223510..0000000 --- a/src/main/java/frc/robot/commands/StablePlateform.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 StablePlateform extends CommandBase { - /** Creates a new StablePlateform. */ - public StablePlateform() { - // 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 75a5406d7eb53b4bfcd72a7b9fdbcbeafb490a36 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 15 Feb 2023 17:12:20 -0500 Subject: [PATCH 05/24] vbjnm --- src/main/java/frc/robot/commands/Gyro.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/commands/Gyro.java b/src/main/java/frc/robot/commands/Gyro.java index f2dd5b8..8492e0d 100644 --- a/src/main/java/frc/robot/commands/Gyro.java +++ b/src/main/java/frc/robot/commands/Gyro.java @@ -23,13 +23,13 @@ public class Gyro extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - if(basePilotable.getpitch()<15) + if(basePilotable.getpitch()<10) { - basePilotable.drive(0.2, 0, 0); + basePilotable.drive(0.4, 0, 0); } - else if(basePilotable.getpitch()>-15) + else if(basePilotable.getpitch()>-10) { - basePilotable.drive(-0.2, 0, 0); + basePilotable.drive(-0.4, 0, 0); } else { From 3b6e00bd4b753b207df17c458af430a6460fcef4 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 15 Feb 2023 17:18:46 -0500 Subject: [PATCH 06/24] fhmcgj --- .../robot/commands/bras/PivotBrasRentre.java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/main/java/frc/robot/commands/bras/PivotBrasRentre.java diff --git a/src/main/java/frc/robot/commands/bras/PivotBrasRentre.java b/src/main/java/frc/robot/commands/bras/PivotBrasRentre.java new file mode 100644 index 0000000..9624497 --- /dev/null +++ b/src/main/java/frc/robot/commands/bras/PivotBrasRentre.java @@ -0,0 +1,47 @@ +// 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 PivotBrasRentre extends CommandBase { + private BrasTelescopique brasTelescopique; + private Pivot pivot; + /** Creates a new PivotBrasRentre. */ + public PivotBrasRentre(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()>1){ + brasTelescopique.AvanceRecule(0.5); + } + if (pivot.distance()>1){ + pivot.monteDescendre(0.5); + } + } + + // 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 12aa68574f449eb62fcb5cd962312b27b055f676 Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Wed, 15 Feb 2023 17:24:38 -0500 Subject: [PATCH 07/24] hello there --- .../java/frc/robot/commands/limelight.java | 32 --------------- .../java/frc/robot/subsystems/Limelight.java | 20 ++++++++- vendordeps/photonlib.json | 41 +++++++++++++++++++ 3 files changed, 60 insertions(+), 33 deletions(-) delete mode 100644 src/main/java/frc/robot/commands/limelight.java create mode 100644 vendordeps/photonlib.json diff --git a/src/main/java/frc/robot/commands/limelight.java b/src/main/java/frc/robot/commands/limelight.java deleted file mode 100644 index 3853a09..0000000 --- a/src/main/java/frc/robot/commands/limelight.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 limelight extends CommandBase { - /** Creates a new limelight. */ - public limelight() { - // 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; - } -} diff --git a/src/main/java/frc/robot/subsystems/Limelight.java b/src/main/java/frc/robot/subsystems/Limelight.java index befd637..64708e0 100644 --- a/src/main/java/frc/robot/subsystems/Limelight.java +++ b/src/main/java/frc/robot/subsystems/Limelight.java @@ -4,11 +4,29 @@ package frc.robot.subsystems; +import org.photonvision.PhotonCamera; +import org.photonvision.common.hardware.VisionLEDMode; + +import edu.wpi.first.net.PortForwarder; import edu.wpi.first.wpilibj2.command.SubsystemBase; + public class Limelight extends SubsystemBase { + PhotonCamera limelight = new PhotonCamera("limelight"); /** Creates a new Limelight. */ - public Limelight() {} + public Limelight() { + PortForwarder.add(5800, "photonvision.local", 5800); + } + + public void cube() { + limelight.setLED(VisionLEDMode.kOff); + limelight.setPipelineIndex(3); + } + + public void Cone() { + limelight.setLED(VisionLEDMode.kOff); + limelight.setPipelineIndex(2); + } @Override public void periodic() { diff --git a/vendordeps/photonlib.json b/vendordeps/photonlib.json new file mode 100644 index 0000000..4f378c4 --- /dev/null +++ b/vendordeps/photonlib.json @@ -0,0 +1,41 @@ +{ + "fileName": "photonlib.json", + "name": "photonlib", + "version": "v2023.3.0", + "uuid": "515fe07e-bfc6-11fa-b3de-0242ac130004 ", + "mavenUrls": [ + "https://maven.photonvision.org/repository/internal", + "https://maven.photonvision.org/repository/snapshots" + ], + "jsonUrl": "https://maven.photonvision.org/repository/internal/org/photonvision/PhotonLib-json/1.0/PhotonLib-json-1.0.json", + "jniDependencies": [], + "cppDependencies": [ + { + "groupId": "org.photonvision", + "artifactId": "PhotonLib-cpp", + "version": "v2023.3.0", + "libName": "Photon", + "headerClassifier": "headers", + "sharedLibrary": true, + "skipInvalidPlatforms": true, + "binaryPlatforms": [ + "windowsx86-64", + "linuxathena", + "linuxx86-64", + "osxuniversal" + ] + } + ], + "javaDependencies": [ + { + "groupId": "org.photonvision", + "artifactId": "PhotonLib-java", + "version": "v2023.3.0" + }, + { + "groupId": "org.photonvision", + "artifactId": "PhotonTargeting-java", + "version": "v2023.3.0" + } + ] +} \ No newline at end of file From a16c2413d87e4b8554b2cc496b4f28320ffc56b7 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 15 Feb 2023 18:03:47 -0500 Subject: [PATCH 08/24] vcgh --- src/main/java/frc/robot/RobotContainer.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index de2c9d0..9cafd77 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -6,6 +6,25 @@ package frc.robot; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +import frc.robot.subsystems.BasePilotable; +import frc.robot.subsystems.Gratte; +import frc.robot.commands.limelight; +import frc.robot.subsystems.bras.BrasTelescopique; +import frc.robot.subsystems.bras.Pince; +import frc.robot.subsystems.bras.Pivot; +import frc.robot.commands.BrakeFerme; +import frc.robot.commands.BrakeOuvre; +import frc.robot.commands.GratteBaisser; +import frc.robot.commands.GratteMonte; +import frc.robot.commands.Gyro; +import frc.robot.commands.bras.FermePince; +import frc.robot.commands.bras.OuvrePince; +import frc.robot.commands.bras.PivotBrasRentre; +import frc.robot.commands.bras.PivoteBrasBas; +import frc.robot.commands.bras.PivoteBrasHaut; +import frc.robot.commands.bras.PivoteBrasMilieux; + + public class RobotContainer { public RobotContainer() { From 2a2cf91fe6f4c2795093cee4d06f82fea57661b4 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 15 Feb 2023 18:06:19 -0500 Subject: [PATCH 09/24] xzcvb --- src/main/java/frc/robot/RobotContainer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 9cafd77..cccb81d 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -6,12 +6,14 @@ package frc.robot; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +//subsystems import frc.robot.subsystems.BasePilotable; import frc.robot.subsystems.Gratte; -import frc.robot.commands.limelight; import frc.robot.subsystems.bras.BrasTelescopique; import frc.robot.subsystems.bras.Pince; import frc.robot.subsystems.bras.Pivot; +import frc.robot.subsystems.Limelight; +// command import frc.robot.commands.BrakeFerme; import frc.robot.commands.BrakeOuvre; import frc.robot.commands.GratteBaisser; @@ -24,8 +26,6 @@ import frc.robot.commands.bras.PivoteBrasBas; import frc.robot.commands.bras.PivoteBrasHaut; import frc.robot.commands.bras.PivoteBrasMilieux; - - public class RobotContainer { public RobotContainer() { configureBindings(); From 89c650e57c61e7159e1c09127d42bb6b4bfb309a Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 15 Feb 2023 18:20:54 -0500 Subject: [PATCH 10/24] zdgxfhml,; --- src/main/java/frc/robot/RobotContainer.java | 25 ++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index cccb81d..71542a8 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -4,6 +4,7 @@ package frc.robot; +import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; //subsystems @@ -27,7 +28,29 @@ import frc.robot.commands.bras.PivoteBrasHaut; import frc.robot.commands.bras.PivoteBrasMilieux; public class RobotContainer { - public RobotContainer() { +XboxController manette1 = new XboxController(0); +XboxController manette2 = new XboxController(1); +// subsystems +BasePilotable basePilotable = new BasePilotable(); +Gratte gratte = new Gratte(); +BrasTelescopique brasTelescopique = new BrasTelescopique(); +Pince pince = new Pince(); +Pivot pivot = new Pivot(); +Limelight limelight = new Limelight(); +//commands +BrakeFerme brakeFerme = new BrakeFerme(basePilotable); +BrakeOuvre brakeOuvre = new BrakeOuvre(basePilotable); +GratteBaisser gratteBaisser = new GratteBaisser(gratte); +GratteMonte gratteMonte = new GratteMonte(gratte); +Gyro gyro = new Gyro(basePilotable); +FermePince fermePince = new FermePince(pince); +OuvrePince ouvrePince = new OuvrePince(pince); +PivotBrasRentre pivotBrasRentre = new PivotBrasRentre(brasTelescopique, pivot); +PivoteBrasBas pivoteBrasBas = new PivoteBrasBas(brasTelescopique, pivot); +PivoteBrasMilieux pivoteBrasMilieux = new PivoteBrasMilieux(brasTelescopique, pivot); +PivoteBrasHaut pivoteBrasHaut = new PivoteBrasHaut(brasTelescopique, pivot); + +public RobotContainer() { configureBindings(); } From af77d6e4a4b5fe2e6136b83b4071833f57898632 Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Wed, 15 Feb 2023 18:23:38 -0500 Subject: [PATCH 11/24] niga --- src/main/java/frc/robot/subsystems/Limelight.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/subsystems/Limelight.java b/src/main/java/frc/robot/subsystems/Limelight.java index 64708e0..ac1d815 100644 --- a/src/main/java/frc/robot/subsystems/Limelight.java +++ b/src/main/java/frc/robot/subsystems/Limelight.java @@ -23,11 +23,21 @@ public class Limelight extends SubsystemBase { limelight.setPipelineIndex(3); } - public void Cone() { + public void cone() { limelight.setLED(VisionLEDMode.kOff); limelight.setPipelineIndex(2); } + public void apriltag() { + limelight.setLED(VisionLEDMode.kOff); + limelight.setPipelineIndex(0); + } + + public void tape() { + limelight.setLED(VisionLEDMode.kOn); + limelight.setPipelineIndex(1); + } + @Override public void periodic() { // This method will be called once per scheduler run From eed8f171e17d562f21f59ff03ac0c4ae0e65f58f Mon Sep 17 00:00:00 2001 From: Olivier Demers Date: Wed, 15 Feb 2023 23:26:45 +0000 Subject: [PATCH 12/24] Removed bin folder --- bin/main/frc/robot/commands/BrakeFerme.class | Bin 982 -> 0 bytes bin/main/frc/robot/commands/BrakeOuvre.class | Bin 982 -> 0 bytes .../frc/robot/subsystems/BasePilotable.class | Bin 3529 -> 0 bytes 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 bin/main/frc/robot/commands/BrakeFerme.class delete mode 100644 bin/main/frc/robot/commands/BrakeOuvre.class delete mode 100644 bin/main/frc/robot/subsystems/BasePilotable.class diff --git a/bin/main/frc/robot/commands/BrakeFerme.class b/bin/main/frc/robot/commands/BrakeFerme.class deleted file mode 100644 index 9911767ccb6bbbfedefdcca16f36a0596a4e226b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 982 zcma)5T~E|d5IuKWD3q=Xiz2A_0V-wJ(8NT2!1w^kK5dL~%_ibgyS;=9+ZJzIzkZW1 zCW?uP{s4cJai-nfZlVc1bb4p*oO9-*{r%_1F91*ATBr%EAL@aplOV~wK@vrN9H!o$ z_D^I->PT8J1zIx9z4xceJ5)N&_%u|(@xyVxw_oD+{8S3m1A4ts!zA;AA^CT^l|Y&Y z>Blsa5lKvE?F!63Rk6yR32eC+0c`gL%>5*kHViB{u;2(7?sk730+$@jVAjH-fO}5q zy>Uf0;hGMXaao|@hv7^4Hdk6kGR{(g9rsQ5qD;G7TcfLD`8RKSuSHrlUnDenWUgNV9~Tgy6F)IXt*5eCAl8Rj^foeD%PE2|DBIJG(>~GErA+u zfKD@XwlGI_p1eN!HF~eKzQb;{zoFhTf1>f)X!p*r^o4F}xI(rGlWc?RBH@}8TgD3G zN;Ixwl|1%Yg^I-*oRP-k!UyJBUr|59wTjg)(5qC>TEWH$${VrK7A72Riu0YQz$^nw z;WA2~m;i4VjdO#K=-~$c0d5w+vi>oUH8!wGmi`jlBg+&I3ZH0<&jlIJqZD_i#A_4r I`$g8)U&kBAQUCw| diff --git a/bin/main/frc/robot/commands/BrakeOuvre.class b/bin/main/frc/robot/commands/BrakeOuvre.class deleted file mode 100644 index 17058de63c61796f1ae924b9f1c2052704f4c714..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 982 zcma)5+fLL_6kTUJP$(S>gCeMS0hH1)G%-;hFg`%S(?pG9CJ~?7=^-4Pws_j&<(qsl zQA|wq1NCx4?o7RZV) z`sU2$LtyRv$=bNdld;Ad6)@!o*(-9|jUkhW z=I9=9$#W{nrPjqsE-5GuSTx%w-Ry`1G+YjK(n9y-zT(w7W7h5C;55J;8lpkpmOza+ zK&L4>o0uUxOJ0}!8oigi@36eqH#EHZPdKlQR_6>0U+AWWD`cCflXb|>6Rt_IMJzF{ zLgOly$zz{Ys93DP9%wu&ePG7>ipCkPjajV{y-fA2lx&Qkya5|+VZ_m*INymem}NjI zTt)>HBjD|_ac=M-J>1|w!1WSX)jtHX#v0bi(qDqRWSQcA=@X6dxg_IxRO0T0cx@zp Iugu!~3ji<2+5i9m diff --git a/bin/main/frc/robot/subsystems/BasePilotable.class b/bin/main/frc/robot/subsystems/BasePilotable.class deleted file mode 100644 index a2332e150d55ae79549ace7f41302a982571b46e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3529 zcmbVO=~vWN6#oT~afYZ=Ma8{}I^Yr&6e-%O!y>1HQa~)y#Y`qZASBZy18VJR?QZR6 z_uYQ)DW|}(J?)2n)c>iczn5fY5NF&tOzwL(@9w{QUvB;P=RW|N@oNNS61EIGn&Q|g z+f&?Z%Dv!v`h=?-S6#iwFl|pwnR)~j5_ak7tTL4`lwrehJ+U&4)YyJSvnM80E3Ne9 zgoUVtm^!IiUfQt@Pr`;IPbrQ*>Dw_hS4kW@*_TnB@ox2etAr~5@Q9k#Mky+*j$`PK z9ttlBx4GAgLVioKs7K0#?b(iITb^T^O1Ib~f{m#=osON&&|u{}WyU0JDkYSq9lloD zjNxHAWO;^awh0bZ#8Qqrp7U{g3Gp^N%l!4(rf%6rT14tg<*Y|XE;zQU*%^8eP2QF8H!?y1&@$)n}*`Zfs_2|KMvAz_V-PX%nEPRa3$0w?+=&I*^J?7 zqr$5?8QZWuFxn%Segqw?LcFc5tA0SlP%mQ%md3CXyCc{oVR!M`mMDjeJx~OU98FE@ zeuX3~qW1a$S~=gB(e<?Ni>!?w6L`0JuyX~Sh|H9winG8UmSh8DC&@I;u* z63CTt7)OW%R;Jz3SPe(Q)_DD0VDHsUnw-?bL# zMI3G)NE)ej$FUt2Gj?1c{Zw|+@iWvXV;QQWIE^zAFux7OOLZso>jqRatIK#6gG~5% zhwV(M4r{XOff^@}ZjE6G&qweaVfY|6WxRkF8NZ(eCH^p$0#K?l9z%650Uf$C!33N} zT818k(W_7Dj+l0phYic{o{XU!qcVn(jA9IC1mhA`6dHzeNC3@q1;(19u#kzsCfFCE zVBU00+EYndG3)$E)_);SCYen-a`Y#lDyI)}ayz zxu;Nol(%HWP$e4jZ5cAE#2|ZDIP;!_@keszQGNLUS0nhaWLNfBdUk@tNOQaGbe7ZI z2h>NnCLxmO?``i%beC?*V#2Kg0H27F&?MUPGZFOX684n}x~PsW{}vd-7oy>)XDxVf zT*B8fzQMP_#OkuxYMvP574frTtS`>!j$x+_jjhmUXB|!NF#Ox=j!&08WBjz>Cqw$64fZ4%ir~#ZAFgwHU@e zyBudij|w~CQeh{23U`GZtzxXeZkBux)QBPvg4JJ4fEy!8v?6gVjQ~ zVisQ&QgM(t0$K^r6$I-_BB_SxS%ni=jTF{!IMw1B*5L+AJI9vzm!E>SaAaP}Zs+Up wT`pz36hx2mS1=Sbb7G#L6bhE%dmb&r5BQOEIad~b!Y@Z_`3W+F8%JyZ2Obe~2><{9 From 4d81dd9f9b748f213ad2254945c657e36d057f52 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 15 Feb 2023 18:27:48 -0500 Subject: [PATCH 13/24] cdf --- .../frc/robot/subsystems/BasePilotable.class | Bin 3529 -> 3529 bytes src/main/java/frc/robot/RobotContainer.java | 4 ++++ .../frc/robot/subsystems/BasePilotable.java | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/main/frc/robot/subsystems/BasePilotable.class b/bin/main/frc/robot/subsystems/BasePilotable.class index a2332e150d55ae79549ace7f41302a982571b46e..20fa95de559406b9cb9fb8c40403e23dadb6ccea 100644 GIT binary patch delta 833 zcmZ`$?N3rs9Da@$?&alRw8AajTs1Zum8~rjj8KulvILb=zvuJo4iaQ(}h~$?27*;UEHYBHO1P%ggMlDAdN?KW4 zD2S`06bfX4E>V~oD9pY~y(T}dQA{Ah{z!q&DT)KIn-Rke1=rbx;fyqcS+;8MnG?9F zV2;4aCJjy_#Vy=szYV_8I}`_DC$I#H$*dYui+SEPh7?5_vwVTM$@+*GklwWoYn_`!o1qm<_mo#~78s3YxT53J!^ko@_(~;TeAW& zJMEYFGq4eQ=-EBj9z5|1?pKhnp;U#tDJ<$jpea1mg-N(bCHnY^5H?!D*Td*4CLLCvR^Wo&@IDqF2H z7}x-VbJj4ecsilGz;H=}1Bx2~TvpM}8>F*R5Lfu1)Z*$yw~8)?T0SM!Ml|%Gior9l zTca7%u#8Mv)L+%0LJ_D>gYyveYj8nPy1XcU433Cy>K234&^X~iCx$hQV3hxndMd^= zoP^hfaZIY1VDRy8@_GJIRva2`BFfj~pc2C!6}S0Uxlx+JUH)4RPQ^7;z{}w7$;MN9 zpPpT!X~r?DK}VEEOhxo%J!|R=O3+9fR)-rB7BtLZ$b}>pRiqdy=dy|BY-T27HHR{3 zu@lP_>+thuj&&sfi}JaqwAUrEBF6NK()(h}B3cz=`c*unEmGIjTR+e7cS>=7j1j!U|1m%vPptSuTAEOgl&>Ig#rHE9qu2*P|41u9sFx|Vh`6OOqTqPnJ_$N z!cj0D^91UzADM+wRy3=k@<xkTi%~Dnb9haE0dMk%9BbP-Y!|g@?krESA#RlqtK;;}@4HU_ E1*A66p#T5? diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 71542a8..715aa36 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -7,6 +7,7 @@ package frc.robot; import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.RunCommand; //subsystems import frc.robot.subsystems.BasePilotable; import frc.robot.subsystems.Gratte; @@ -52,6 +53,9 @@ PivoteBrasHaut pivoteBrasHaut = new PivoteBrasHaut(brasTelescopique, pivot); public RobotContainer() { configureBindings(); + + basePilotable.setDefaultCommand(brakeOuvre); + new RunCommand(basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), -manette1.getLeftTriggerAxis()+manette.getRightTriggerAxis()), basePilotable), null)); } private void configureBindings() {} diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index 9b1eb24..4ed9d06 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -32,7 +32,7 @@ public class BasePilotable extends SubsystemBase { return gyroscope.getPitch(); } - public void drive(double xSpeed, double zRotation, int i){ + public void drive(double xSpeed, double zRotation, double d){ drive.arcadeDrive(xSpeed, zRotation); } public double distance(){ From 52539e1f4fe2ca89903a5c2bf64fe4bfbb283abb Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 15 Feb 2023 18:29:34 -0500 Subject: [PATCH 14/24] jgfhfcnh --- src/main/java/frc/robot/Constants.java | 3 ++- .../java/frc/robot/commands/GratteBaisser.java | 17 +++++++++++++++-- .../java/frc/robot/commands/GratteMonte.java | 13 ++++++++++++- .../robot/commands/bras/PivotBrasRentre.java | 3 +++ .../robot/subsystems/bras/BrasTelescopique.java | 6 +++++- 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 450a43b..e306ca1 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -17,11 +17,12 @@ public class Constants { public static int actuateur = 2; public static int brakedroit = 3; public static int brakegauche = 4; - // DIO Brando + // DIO public static int limitbd = 0; public static int limitbg = 2; public static int limithd = 3; public static int limithg = 1; + public static int photocell = 4; } diff --git a/src/main/java/frc/robot/commands/GratteBaisser.java b/src/main/java/frc/robot/commands/GratteBaisser.java index b423033..de68b8f 100644 --- a/src/main/java/frc/robot/commands/GratteBaisser.java +++ b/src/main/java/frc/robot/commands/GratteBaisser.java @@ -3,10 +3,10 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot.commands; - import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.Gratte; + public class GratteBaisser extends CommandBase { private Gratte gratte; /** Creates a new GratteBaisser. */ @@ -23,7 +23,20 @@ public class GratteBaisser extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - gratte.baiser(0.5); + if(gratte.basd()){ + gratte.baiser(0); + } + else{ + gratte.baiser(0.5); + } + if(gratte.basg()){ + gratte.baiser(0); + } + else{ + gratte.baiser(0.5); + } + + } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/GratteMonte.java b/src/main/java/frc/robot/commands/GratteMonte.java index 15f2b31..950dcd2 100644 --- a/src/main/java/frc/robot/commands/GratteMonte.java +++ b/src/main/java/frc/robot/commands/GratteMonte.java @@ -23,7 +23,18 @@ public class GratteMonte extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - gratte.Lever(0.5); + if(gratte.hautd()){ + gratte.Lever(0); + } + else{ + gratte.Lever(0.5); + } + if(gratte.hautg()) { + gratte.Lever(0.5); + } + else{ + gratte.Lever(0.5); + } } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/bras/PivotBrasRentre.java b/src/main/java/frc/robot/commands/bras/PivotBrasRentre.java index 9624497..e9af669 100644 --- a/src/main/java/frc/robot/commands/bras/PivotBrasRentre.java +++ b/src/main/java/frc/robot/commands/bras/PivotBrasRentre.java @@ -33,6 +33,9 @@ public class PivotBrasRentre extends CommandBase { if (pivot.distance()>1){ pivot.monteDescendre(0.5); } + else if(brasTelescopique.photocell()){ + brasTelescopique.Reset(); + } } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java b/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java index f4f1458..2808ceb 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.DigitalInput; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; @@ -15,6 +16,7 @@ public class BrasTelescopique extends SubsystemBase { /** Creates a new BrasTelescopique. */ public BrasTelescopique() {} final CANSparkMax Winch = new CANSparkMax(Constants.BrasTelescopique,MotorType.kBrushless); + private DigitalInput photocell = new DigitalInput(Constants.photocell); public void AvanceRecule(double vitesse) { Winch.set(vitesse); } @@ -24,7 +26,9 @@ public class BrasTelescopique extends SubsystemBase { public void Reset() { Winch.getEncoder().setPosition(0); } - + public boolean photocell(){ + return photocell.get(); + } @Override public void periodic() { // This method will be called once per scheduler run From f57a481554e3722975989f6ff436261656df1043 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 15 Feb 2023 18:35:35 -0500 Subject: [PATCH 15/24] fhghj --- .../frc/robot/subsystems/BasePilotable.class | Bin 3529 -> 3591 bytes src/main/java/frc/robot/RobotContainer.java | 5 +++-- .../frc/robot/subsystems/BasePilotable.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/main/frc/robot/subsystems/BasePilotable.class b/bin/main/frc/robot/subsystems/BasePilotable.class index 20fa95de559406b9cb9fb8c40403e23dadb6ccea..4fa115f0f2e85cfa728212880d73812a328be609 100644 GIT binary patch delta 1111 zcmZ`&Yf}?f7=8}B*-bVF8>>JCW)RyMAdE6)5KW=VJvdN{L7_2f31Ni3c{5elfF?eV*q%@3ZH5&+dzg#Y*Gl z>K{)5?7=U;8|R8NZ*5msSO1b{2Wt^mi{|Q!N5hsm5S>ce;n69R!8sPS>~JDty1=l9 z!vW2J4=p<06Sc~Ar4{dsK4rISKiYM)F;s~YN>zZP10@XZanl}1T2VWiOvwH&4jr0A zJsi#)>g8}j)7m_=Df%%u0;Xl!3`%X?kQ@7PkmExPi2sz1&4V0oz~jOZ4C@$T@QP>Z zJK|SWb8viwpg5zpY9SogaZEf_>y#7tSp2KD#=;z%;bAa3QsGIn$4td3%@K@omU;QpwSz-O!m#$eGxd97mji9dIFu zX&tA;HAkb8f+e0i+MPapB0XlrCT;JI7(SKZTSy=4iH*rF7}=a(rUd^_=0If(@11t zXV9D%P8WpEyzp5;=*|mY6a+sBvq9QSv-&5_1{FfxgIS!B!UaFh=__Cwy3DM ze}D!<3M{SiQT+p-eDEiDvFs)ZJXtkUea^YdoZH+yW2kK^r36Pb)Z-}47ENJI8p08wM++=6j?po3x6q0< z`avw#x1&SGae`DjDW>W)oIoc{))kkZ)UX8+1gdGMyWdt}8ya95)x>d6v;ky9z%3Z zR~A+PH?O-uus@@^E|9QwXQqWW8sQTUvhyoi@P%Ju+562 zP9=)@y@&g>Mk$K5V~+2qLq$6%FMdR@H&E8zS55aiHrYIIKSGV)h&kYL3438oqc9%om@Z<3_3ljSCV8htoz{EPyt2WLDO z@WJIpZa^3g3Z{T?F({Y=!sVb)!Guw6Em!=4F{{9kx!H#aFQ$SKlh_#yRro{GER@BI zrrA5?!;BXhOloIdZhP>6Jw812qH$B3_h5cq>tb5G)rTiu#PVWs8BeJ-)FQk-jH?RZxj_YW!8_=Ere diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 715aa36..a7c9738 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -55,8 +55,9 @@ public RobotContainer() { configureBindings(); basePilotable.setDefaultCommand(brakeOuvre); - new RunCommand(basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), -manette1.getLeftTriggerAxis()+manette.getRightTriggerAxis()), basePilotable), null)); - } + basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), -manette1.getLeftTriggerAxis()+manette1.getRightTriggerAxis(), basePilotable); +} + private void configureBindings() {} diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index 4ed9d06..2156046 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -32,7 +32,7 @@ public class BasePilotable extends SubsystemBase { return gyroscope.getPitch(); } - public void drive(double xSpeed, double zRotation, double d){ + public void drive(double xSpeed, double zRotation, double d, BasePilotable basePilotable){ drive.arcadeDrive(xSpeed, zRotation); } public double distance(){ From 9c97072db168ba0ba7b913c138d1d672ab586c23 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 15 Feb 2023 18:54:35 -0500 Subject: [PATCH 16/24] hjymjghn --- src/main/java/frc/robot/Constants.java | 4 +++- .../frc/robot/commands/bras/PivotBrasRentre.java | 11 +++++++++++ src/main/java/frc/robot/subsystems/bras/Pivot.java | 13 ++++++++++--- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index e306ca1..f0fb8a8 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -6,8 +6,9 @@ public class Constants { public static int arrieredroit = 2; public static int arrieregauche = 3; public static int BrasTelescopique = 4; + public static int pivot = 5; - //moteur gris + //moteur public static int leverGratte = 0; public static int baisserGratte = 1; @@ -23,6 +24,7 @@ public class Constants { public static int limithd = 3; public static int limithg = 1; public static int photocell = 4; + public static int limitpivot = 5; } diff --git a/src/main/java/frc/robot/commands/bras/PivotBrasRentre.java b/src/main/java/frc/robot/commands/bras/PivotBrasRentre.java index e9af669..192dc88 100644 --- a/src/main/java/frc/robot/commands/bras/PivotBrasRentre.java +++ b/src/main/java/frc/robot/commands/bras/PivotBrasRentre.java @@ -35,6 +35,17 @@ public class PivotBrasRentre extends CommandBase { } else if(brasTelescopique.photocell()){ brasTelescopique.Reset(); + brasTelescopique.AvanceRecule(0); + } + else{ + brasTelescopique.AvanceRecule(.5); + } + if(pivot.limitpivot()){ + pivot.Reset(); + pivot.monteDescendre(0); + } + else{ + pivot.monteDescendre(0.5); } } diff --git a/src/main/java/frc/robot/subsystems/bras/Pivot.java b/src/main/java/frc/robot/subsystems/bras/Pivot.java index e8d5dbb..b2e3214 100644 --- a/src/main/java/frc/robot/subsystems/bras/Pivot.java +++ b/src/main/java/frc/robot/subsystems/bras/Pivot.java @@ -4,14 +4,17 @@ package frc.robot.subsystems.bras; +import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj2.command.SubsystemBase; +import frc.robot.Constants; + import com.revrobotics.CANSparkMax; -import com.revrobotics.CANSparkMaxLowLevel.MotorType; -import static frc.robot.Constants.*; +import com.revrobotics.CANSparkMaxLowLevel.MotorType; public class Pivot extends SubsystemBase { // moteur - private CANSparkMax pivot = new CANSparkMax(actuateur, MotorType.kBrushless); + private CANSparkMax pivot = new CANSparkMax(Constants.pivot,MotorType.kBrushless); + private DigitalInput limitpivot = new DigitalInput(Constants.limitpivot); // function public void monteDescendre(double vitesse) { @@ -23,6 +26,10 @@ public class Pivot extends SubsystemBase { } public void Reset(){ pivot.getEncoder().setPosition(0); + + } + public boolean limitpivot(){ + return limitpivot.get(); } @Override public void periodic() { From 67b762d877e936a6182cf9980163dacd18d1a503 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 15 Feb 2023 18:56:04 -0500 Subject: [PATCH 17/24] zxcvbnm, --- .../frc/robot/subsystems/BasePilotable.class | Bin 3591 -> 3529 bytes src/main/java/frc/robot/RobotContainer.java | 8 +++++++- .../frc/robot/subsystems/BasePilotable.java | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/main/frc/robot/subsystems/BasePilotable.class b/bin/main/frc/robot/subsystems/BasePilotable.class index 4fa115f0f2e85cfa728212880d73812a328be609..20fa95de559406b9cb9fb8c40403e23dadb6ccea 100644 GIT binary patch delta 1069 zcmZ`&*-{fh6g|yMW+szi5m|~|OArVpZmfa`A+n2X27(A8M2v)>B!UaFh=__Cwy3DM ze}D!<3M{SiQT+p-eDEiDvFs)ZJXtkUea^YdoZH+yW2kK^r36Pb)Z-}47ENJI8p08wM++=6j?po3x6q0< z`avw#x1&SGae`DjDW>W)oIoc{))kkZ)UX8+1gdGMyWdt}8ya95)x>d6v;ky9z%3Z zR~A+PH?O-uus@@^E|9QwXQqWW8sQTUvhyoi@P%Ju+562 zP9=)@y@&g>Mk$K5V~+2qLq$6%FMdR@H&E8zS55aiHrYIIKSGV)h&kYL3438oqc9%om@Z<3_3ljSCV8htoz{EPyt2WLDO z@WJIpZa^3g3Z{T?F({Y=!sVb)!Guw6Em!=4F{{9kx!H#aFQ$SKlh_#yRro{GER@BI zrrA5?!;BXhOloIdZhP>6Jw812qH$B3_h5cq>tb5G)rTiu#PVWs8BeJ-)FQk-jH?RZxj_YW!8_=Ere delta 1111 zcmZ`&Yf}?f7=8}B*-bVF8>>JCW)RyMAdE6)5KW=VJvdN{L7_2f31Ni3c{5elfF?eV*q%@3ZH5&+dzg#Y*Gl z>K{)5?7=U;8|R8NZ*5msSO1b{2Wt^mi{|Q!N5hsm5S>ce;n69R!8sPS>~JDty1=l9 z!vW2J4=p<06Sc~Ar4{dsK4rISKiYM)F;s~YN>zZP10@XZanl}1T2VWiOvwH&4jr0A zJsi#)>g8}j)7m_=Df%%u0;Xl!3`%X?kQ@7PkmExPi2sz1&4V0oz~jOZ4C@$T@QP>Z zJK|SWb8viwpg5zpY9SogaZEf_>y#7tSp2KD#=;z%;bAa3QsGIn$4td3%@K@omU;QpwSz-O!m#$eGxd97mji9dIFu zX&tA;HAkb8f+e0i+MPapB0XlrCT;JI7(SKZTSy=4iH*rF7}=a(rUd^_=0If(@11t zXV9D%P8WpEyzp5;=*|mY6a+sBvq9QSv-&5_1{FfxgIS! Date: Wed, 15 Feb 2023 19:18:18 -0500 Subject: [PATCH 18/24] gcvhbjn --- src/main/java/frc/robot/RobotContainer.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 390c2a1..8b66343 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -9,7 +9,9 @@ import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.RunCommand; +import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.button.JoystickButton; +import edu.wpi.first.wpilibj2.command.button.Trigger; //subsystems import frc.robot.subsystems.BasePilotable; import frc.robot.subsystems.Gratte; @@ -57,14 +59,19 @@ public RobotContainer() { configureBindings(); basePilotable.setDefaultCommand(brakeOuvre); - basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), -manette1.getLeftTriggerAxis()+manette1.getRightTriggerAxis(), basePilotable); + basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), -manette1.getLeftTriggerAxis()+manette1.getRightTriggerAxis()); } private void configureBindings() { + XboxController exampleController = new XboxController(2); + Trigger aButton = new JoystickButton(exampleController, XboxController.Button.kY.value); + + + + + - JoystickButton buttonA = new JoystickButton(manette1, XboxController.Button.kA.value); - buttonA.whenPressed() } public Command getAutonomousCommand() { From 0f1f54cd797ef7ac45f4bad87990bbcd962accc0 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 15 Feb 2023 19:18:42 -0500 Subject: [PATCH 19/24] b gnv --- src/main/java/frc/robot/RobotContainer.java | 2 + src/main/java/frc/robot/commands/Reculer.java | 41 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/main/java/frc/robot/commands/Reculer.java diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index a7c9738..5fe595c 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -8,6 +8,7 @@ import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.RunCommand; +import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; //subsystems import frc.robot.subsystems.BasePilotable; import frc.robot.subsystems.Gratte; @@ -63,5 +64,6 @@ public RobotContainer() { public Command getAutonomousCommand() { return Commands.print("No autonomous command configured"); + } } diff --git a/src/main/java/frc/robot/commands/Reculer.java b/src/main/java/frc/robot/commands/Reculer.java new file mode 100644 index 0000000..d7c8c67 --- /dev/null +++ b/src/main/java/frc/robot/commands/Reculer.java @@ -0,0 +1,41 @@ +// 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; +import frc.robot.subsystems.BasePilotable; + +public class Reculer extends CommandBase { + BasePilotable basePilotable; + /** Creates a new Reculer. */ + public Reculer(BasePilotable basePilotable) { + this.basePilotable = basePilotable; + // Use addRequirements() here to declare subsystem dependencies. + addRequirements(basePilotable); + } + + // Called when the command is initially scheduled. + @Override + public void initialize() { + basePilotable.Reset(); + } + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + basePilotable.drive(0.2, 0, 10, basePilotable); + } + + // 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 74e884d4ac37317098b36a2759a285717a884264 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 15 Feb 2023 19:19:41 -0500 Subject: [PATCH 20/24] dgbfb --- .../frc/robot/subsystems/BasePilotable.class | Bin 3529 -> 3591 bytes .../frc/robot/subsystems/BasePilotable.java | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/main/frc/robot/subsystems/BasePilotable.class b/bin/main/frc/robot/subsystems/BasePilotable.class index 20fa95de559406b9cb9fb8c40403e23dadb6ccea..4fa115f0f2e85cfa728212880d73812a328be609 100644 GIT binary patch delta 1111 zcmZ`&Yf}?f7=8}B*-bVF8>>JCW)RyMAdE6)5KW=VJvdN{L7_2f31Ni3c{5elfF?eV*q%@3ZH5&+dzg#Y*Gl z>K{)5?7=U;8|R8NZ*5msSO1b{2Wt^mi{|Q!N5hsm5S>ce;n69R!8sPS>~JDty1=l9 z!vW2J4=p<06Sc~Ar4{dsK4rISKiYM)F;s~YN>zZP10@XZanl}1T2VWiOvwH&4jr0A zJsi#)>g8}j)7m_=Df%%u0;Xl!3`%X?kQ@7PkmExPi2sz1&4V0oz~jOZ4C@$T@QP>Z zJK|SWb8viwpg5zpY9SogaZEf_>y#7tSp2KD#=;z%;bAa3QsGIn$4td3%@K@omU;QpwSz-O!m#$eGxd97mji9dIFu zX&tA;HAkb8f+e0i+MPapB0XlrCT;JI7(SKZTSy=4iH*rF7}=a(rUd^_=0If(@11t zXV9D%P8WpEyzp5;=*|mY6a+sBvq9QSv-&5_1{FfxgIS!B!UaFh=__Cwy3DM ze}D!<3M{SiQT+p-eDEiDvFs)ZJXtkUea^YdoZH+yW2kK^r36Pb)Z-}47ENJI8p08wM++=6j?po3x6q0< z`avw#x1&SGae`DjDW>W)oIoc{))kkZ)UX8+1gdGMyWdt}8ya95)x>d6v;ky9z%3Z zR~A+PH?O-uus@@^E|9QwXQqWW8sQTUvhyoi@P%Ju+562 zP9=)@y@&g>Mk$K5V~+2qLq$6%FMdR@H&E8zS55aiHrYIIKSGV)h&kYL3438oqc9%om@Z<3_3ljSCV8htoz{EPyt2WLDO z@WJIpZa^3g3Z{T?F({Y=!sVb)!Guw6Em!=4F{{9kx!H#aFQ$SKlh_#yRro{GER@BI zrrA5?!;BXhOloIdZhP>6Jw812qH$B3_h5cq>tb5G)rTiu#PVWs8BeJ-)FQk-jH?RZxj_YW!8_=Ere diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index 4ed9d06..2156046 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -32,7 +32,7 @@ public class BasePilotable extends SubsystemBase { return gyroscope.getPitch(); } - public void drive(double xSpeed, double zRotation, double d){ + public void drive(double xSpeed, double zRotation, double d, BasePilotable basePilotable){ drive.arcadeDrive(xSpeed, zRotation); } public double distance(){ From 9b625fba889aab5fe3408ea0c1e8b7e089e24fbc Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 15 Feb 2023 19:20:58 -0500 Subject: [PATCH 21/24] dtshj --- .../frc/robot/subsystems/BasePilotable.class | Bin 3591 -> 3529 bytes .../frc/robot/subsystems/BasePilotable.java | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/main/frc/robot/subsystems/BasePilotable.class b/bin/main/frc/robot/subsystems/BasePilotable.class index 4fa115f0f2e85cfa728212880d73812a328be609..20fa95de559406b9cb9fb8c40403e23dadb6ccea 100644 GIT binary patch delta 1069 zcmZ`&*-{fh6g|yMW+szi5m|~|OArVpZmfa`A+n2X27(A8M2v)>B!UaFh=__Cwy3DM ze}D!<3M{SiQT+p-eDEiDvFs)ZJXtkUea^YdoZH+yW2kK^r36Pb)Z-}47ENJI8p08wM++=6j?po3x6q0< z`avw#x1&SGae`DjDW>W)oIoc{))kkZ)UX8+1gdGMyWdt}8ya95)x>d6v;ky9z%3Z zR~A+PH?O-uus@@^E|9QwXQqWW8sQTUvhyoi@P%Ju+562 zP9=)@y@&g>Mk$K5V~+2qLq$6%FMdR@H&E8zS55aiHrYIIKSGV)h&kYL3438oqc9%om@Z<3_3ljSCV8htoz{EPyt2WLDO z@WJIpZa^3g3Z{T?F({Y=!sVb)!Guw6Em!=4F{{9kx!H#aFQ$SKlh_#yRro{GER@BI zrrA5?!;BXhOloIdZhP>6Jw812qH$B3_h5cq>tb5G)rTiu#PVWs8BeJ-)FQk-jH?RZxj_YW!8_=Ere delta 1111 zcmZ`&Yf}?f7=8}B*-bVF8>>JCW)RyMAdE6)5KW=VJvdN{L7_2f31Ni3c{5elfF?eV*q%@3ZH5&+dzg#Y*Gl z>K{)5?7=U;8|R8NZ*5msSO1b{2Wt^mi{|Q!N5hsm5S>ce;n69R!8sPS>~JDty1=l9 z!vW2J4=p<06Sc~Ar4{dsK4rISKiYM)F;s~YN>zZP10@XZanl}1T2VWiOvwH&4jr0A zJsi#)>g8}j)7m_=Df%%u0;Xl!3`%X?kQ@7PkmExPi2sz1&4V0oz~jOZ4C@$T@QP>Z zJK|SWb8viwpg5zpY9SogaZEf_>y#7tSp2KD#=;z%;bAa3QsGIn$4td3%@K@omU;QpwSz-O!m#$eGxd97mji9dIFu zX&tA;HAkb8f+e0i+MPapB0XlrCT;JI7(SKZTSy=4iH*rF7}=a(rUd^_=0If(@11t zXV9D%P8WpEyzp5;=*|mY6a+sBvq9QSv-&5_1{FfxgIS! Date: Wed, 15 Feb 2023 19:25:28 -0500 Subject: [PATCH 22/24] hgn --- src/main/java/frc/robot/commands/Reculer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/commands/Reculer.java b/src/main/java/frc/robot/commands/Reculer.java index d7c8c67..ce9aecf 100644 --- a/src/main/java/frc/robot/commands/Reculer.java +++ b/src/main/java/frc/robot/commands/Reculer.java @@ -26,7 +26,7 @@ public class Reculer extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - basePilotable.drive(0.2, 0, 10, basePilotable); + basePilotable.drive(0.2, 0, 0); } // Called once the command ends or is interrupted. From 9536969fcefe11becda219b92838d085aa6222a0 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 15 Feb 2023 19:35:25 -0500 Subject: [PATCH 23/24] b v --- src/main/java/frc/robot/RobotContainer.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 0315ac8..4a5236f 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -33,6 +33,7 @@ import frc.robot.commands.BrakeOuvre; import frc.robot.commands.GratteBaisser; import frc.robot.commands.GratteMonte; import frc.robot.commands.Gyro; +import frc.robot.commands.Reculer; import frc.robot.commands.bras.FermePince; import frc.robot.commands.bras.OuvrePince; import frc.robot.commands.bras.PivotBrasRentre; @@ -84,6 +85,11 @@ public RobotContainer() { public Command getAutonomousCommand() { return Commands.print("No autonomous command configured"); - + return new SequentialCommandGroup( + new PivoteBrasMilieux(brasTelescopique, pivot), + new OuvrePince(pince), + new PivotBrasRentre(brasTelescopique, pivot).alongWith(new Reculer(basePilotable)), + new Gyro(basePilotable) + ); } } From 8574a8e5bf272570ced532a2cea12cf3127c73f8 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 15 Feb 2023 19:36:00 -0500 Subject: [PATCH 24/24] fas --- src/main/java/frc/robot/RobotContainer.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 0315ac8..017cf52 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -9,17 +9,11 @@ import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.RunCommand; -<<<<<<< HEAD import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.button.JoystickButton; import edu.wpi.first.wpilibj2.command.button.Trigger; -======= -<<<<<<< HEAD import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; -======= import edu.wpi.first.wpilibj2.command.button.JoystickButton; ->>>>>>> ded3f6018fe8a2c8b719139889c406330ff44003 ->>>>>>> f1d0e3b3526aaeeafab0416ba8e92344786ea73c //subsystems import frc.robot.subsystems.BasePilotable; import frc.robot.subsystems.Gratte; @@ -66,15 +60,14 @@ PivoteBrasHaut pivoteBrasHaut = new PivoteBrasHaut(brasTelescopique, pivot); public RobotContainer() { configureBindings(); - basePilotable.setDefaultCommand(brakeOuvre); - basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), -manette1.getLeftTriggerAxis()+manette1.getRightTriggerAxis()); + basePilotable.setDefaultCommand(new RunCommand(() -> { + basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX()); + },basePilotable)); + } - private void configureBindings() { - XboxController exampleController = new XboxController(2); - Trigger aButton = new JoystickButton(exampleController, XboxController.Button.kY.value); - +